@sumaris-net/ngx-components 0.25.7 → 0.25.11

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.
Files changed (32) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +234 -147
  2. package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
  3. package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
  4. package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
  5. package/esm2015/public_api.js +3 -1
  6. package/esm2015/src/app/core/core.module.js +4 -1
  7. package/esm2015/src/app/core/form/form-error-translate.pipe.js +19 -0
  8. package/esm2015/src/app/core/form/form-error.adapter.js +56 -0
  9. package/esm2015/src/app/core/install/install-upgrade-card.component.js +66 -49
  10. package/esm2015/src/app/core/services/model/person.model.js +4 -3
  11. package/esm2015/src/app/core/services/platform.service.js +38 -44
  12. package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +10 -3
  13. package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +2 -2
  14. package/esm2015/src/app/shared/material/datetime/material.datetime.js +12 -7
  15. package/esm2015/src/app/shared/material/datetime/testing/mat-date-time.test.js +5 -3
  16. package/esm2015/src/app/shared/material/latlong/material.latlong.js +12 -17
  17. package/esm2015/src/app/shared/material/latlong/testing/latlong.test.js +2 -2
  18. package/fesm2015/sumaris-net.ngx-components.js +204 -116
  19. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  20. package/package.json +1 -1
  21. package/public_api.d.ts +2 -0
  22. package/src/app/core/form/form-error-translate.pipe.d.ts +8 -0
  23. package/src/app/core/form/form-error.adapter.d.ts +16 -0
  24. package/src/app/core/install/install-upgrade-card.component.d.ts +6 -4
  25. package/src/app/core/services/platform.service.d.ts +4 -3
  26. package/src/app/shared/material/datetime/material.datetime.d.ts +4 -3
  27. package/src/app/shared/material/latlong/material.latlong.d.ts +5 -6
  28. package/src/assets/i18n/en-US.json +4 -0
  29. package/src/assets/i18n/en.json +4 -0
  30. package/src/theme/_icons.scss +0 -2
  31. package/src/theme/_ionic.scss +7 -0
  32. 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.25.7",
4
+ "version": "0.25.11",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -105,6 +105,7 @@ export * from './src/app/core/services/pipes/account.pipes';
105
105
  export * from './src/app/core/services/pipes/department-to-string.pipe';
106
106
  export * from './src/app/core/services/pipes/person-to-string.pipe';
107
107
  export * from './src/app/core/services/pipes/usage-mode.pipes';
108
+ export * from './src/app/core/form/form-error-translate.pipe';
108
109
  export * from './src/app/vendor';
109
110
  export * from './src/app/core/services/platform.service';
110
111
  export * from './src/app/core/services/network.service';
@@ -127,6 +128,7 @@ export * from './src/app/core/form/form.class';
127
128
  export * from './src/app/core/form/form.utils';
128
129
  export * from './src/app/core/form/form-buttons-bar.component';
129
130
  export * from './src/app/core/form/list.form';
131
+ export * from './src/app/core/form/form-error.adapter';
130
132
  export * from './src/app/core/form/properties.form';
131
133
  export * from './src/app/core/table/table.class';
132
134
  export * from './src/app/core/table/table.utils';
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { FormErrorAdapter, FormErrorAdapterOptions } from './form-error.adapter';
4
+ export declare class FormErrorTranslatePipe implements PipeTransform {
5
+ private adapter;
6
+ constructor(adapter: FormErrorAdapter);
7
+ transform(form: FormGroup, opts?: FormErrorAdapterOptions): string;
8
+ }
@@ -0,0 +1,16 @@
1
+ import { TranslateService } from '@ngx-translate/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ export interface FormErrorAdapterOptions {
4
+ i18nPrefix?: string;
5
+ separator?: string;
6
+ recursive?: boolean;
7
+ }
8
+ export declare class FormErrorAdapter {
9
+ private translate;
10
+ constructor(translate: TranslateService);
11
+ formatError(form: FormGroup, opts?: FormErrorAdapterOptions): string;
12
+ protected getI18nFieldName(fieldName: string, opts?: {
13
+ i18nPrefix?: string;
14
+ }): string;
15
+ protected getI18nError(errorKey: string, errorContent?: any): string;
16
+ }
@@ -28,6 +28,7 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
28
28
  private _subscription;
29
29
  private _showUpdateOfflineFeature;
30
30
  loading: boolean;
31
+ canDownload: boolean;
31
32
  downloading: boolean;
32
33
  waitingNetwork: boolean;
33
34
  installLinks: InstallAppLink[];
@@ -42,7 +43,7 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
42
43
  get showUpdateOfflineFeature(): boolean;
43
44
  onUpdateOfflineModeClick: EventEmitter<UIEvent>;
44
45
  constructor(modalCtrl: ModalController, configService: ConfigService, toastController: ToastController, alertController: AlertController, translate: TranslateService, cd: ChangeDetectorRef, platform: PlatformService, network: NetworkService, environment: any);
45
- ngOnInit(): Promise<void>;
46
+ ngOnInit(): void;
46
47
  ngOnDestroy(): void;
47
48
  download(event: UIEvent, link: InstallAppLink): Promise<void>;
48
49
  tryOnline(): Promise<void>;
@@ -53,9 +54,10 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
53
54
  private getCompatibleUpgradeLinks;
54
55
  private getLinks;
55
56
  private getFilename;
56
- private markForCheck;
57
- private showToast;
58
- private listenDownloadPromise;
57
+ private listenDownloadJobs;
58
+ private listenDownloadJob;
59
59
  private showDownloadFailedToast;
60
60
  private showDownloadCompleteDialog;
61
+ private markForCheck;
62
+ private showToast;
61
63
  }
@@ -15,6 +15,7 @@ import { EntitiesStorage } from './storage/entities-storage.service';
15
15
  import { ShowToastOptions } from '../../shared/toasts';
16
16
  import { TranslateService } from '@ngx-translate/core';
17
17
  import { AccountService } from './account.service';
18
+ import { Observable } from 'rxjs';
18
19
  import { ConfigService } from './config.service';
19
20
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
20
21
  import { Downloader, DownloadRequest } from '@ionic-native/downloader/ngx';
@@ -44,7 +45,7 @@ export declare class PlatformService {
44
45
  private _mobile;
45
46
  private _cordova;
46
47
  private _android;
47
- private _downloadingPromise;
48
+ private _downloadingJobs;
48
49
  touchUi: boolean;
49
50
  get started(): boolean;
50
51
  get mobile(): boolean;
@@ -70,11 +71,11 @@ export declare class PlatformService {
70
71
  checkPeriod: number;
71
72
  }): Promise<any>;
72
73
  open(url: string, target?: string, features?: string, replace?: boolean): void;
73
- getDownloadingPromise(uri: string): Promise<string> | undefined;
74
+ getDownloadingJob(uri: string): Observable<string>;
74
75
  download(request: {
75
76
  uri: string;
76
77
  filename?: string;
77
- } & Partial<DownloadRequest>): Promise<string>;
78
+ } & Partial<DownloadRequest>): Observable<string>;
78
79
  protected configureCordovaPlugins(mobile: boolean): void;
79
80
  protected configureTranslate(): void;
80
81
  protected configureCache(online?: boolean): void;
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core';
2
2
  import { Platform } from '@ionic/angular';
3
3
  import { DateAdapter } from '@angular/material/core';
4
4
  import { FloatLabelType } from '@angular/material/form-field';
@@ -32,8 +32,8 @@ export declare class MatDateTime implements OnInit, OnDestroy, ControlValueAcces
32
32
  protected writing: boolean;
33
33
  protected disabling: boolean;
34
34
  protected _tabindex: number;
35
- protected _onDestroy: EventEmitter<any>;
36
35
  protected waitHideKeyboardDelay: number;
36
+ _readonly: boolean;
37
37
  dateFormControl: FormControl;
38
38
  timeFormControl: FormControl;
39
39
  displayPattern: string;
@@ -46,11 +46,12 @@ export declare class MatDateTime implements OnInit, OnDestroy, ControlValueAcces
46
46
  formControlName: string;
47
47
  placeholder: string;
48
48
  floatLabel: FloatLabelType;
49
- readonly: boolean;
50
49
  required: boolean;
51
50
  compact: boolean;
52
51
  placeholderChar: string;
53
52
  autofocus: boolean;
53
+ set readonly(value: boolean);
54
+ get readonly(): boolean;
54
55
  set tabindex(value: number);
55
56
  get tabindex(): number;
56
57
  get value(): any;
@@ -1,11 +1,11 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { Platform } from '@ionic/angular';
3
3
  import { FloatLabelType } from '@angular/material/form-field';
4
4
  import { ControlValueAccessor, FormBuilder, FormControl, FormGroupDirective } from '@angular/forms';
5
5
  import { TranslateService } from '@ngx-translate/core';
6
6
  import { LatLongFormatFn, LatLongFormatOptions, LatLongPattern } from './latlong.utils';
7
7
  import { TextMaskConfig } from 'angular2-text-mask';
8
- export declare class MatLatLongField implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor {
8
+ export declare class MatLatLongField implements OnInit, OnDestroy, ControlValueAccessor {
9
9
  private platform;
10
10
  private translate;
11
11
  private formBuilder;
@@ -16,6 +16,7 @@ export declare class MatLatLongField implements OnInit, AfterViewInit, OnDestroy
16
16
  private _subscription;
17
17
  protected disabling: boolean;
18
18
  protected writing: boolean;
19
+ _readonly: boolean;
19
20
  formatFn: LatLongFormatFn;
20
21
  formatFnOptions: LatLongFormatOptions;
21
22
  textMaskConfig: TextMaskConfig;
@@ -36,17 +37,15 @@ export declare class MatLatLongField implements OnInit, AfterViewInit, OnDestroy
36
37
  maxDecimals: number;
37
38
  placeholderChar: string;
38
39
  floatLabel: FloatLabelType;
39
- readonly: boolean;
40
+ set readonly(value: boolean);
41
+ get readonly(): boolean;
40
42
  required: boolean;
41
43
  tabindex: number;
42
44
  onBlur: EventEmitter<FocusEvent>;
43
45
  onFocus: EventEmitter<FocusEvent>;
44
46
  inputElement: ElementRef;
45
- suffixDiv: ElementRef;
46
- suffixInjections: QueryList<ElementRef>;
47
47
  constructor(platform: Platform, translate: TranslateService, formBuilder: FormBuilder, cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
48
48
  ngOnInit(): void;
49
- ngAfterViewInit(): void;
50
49
  ngOnDestroy(): void;
51
50
  writeValue(obj: any): void;
52
51
  registerOnChange(fn: any): void;
@@ -469,6 +469,7 @@
469
469
  "BAD_UPDATE_DATE": "Unable to save.<small><br/>Concurrent change detected. Please reload this page and retry.</small>",
470
470
  "DATA_LOCKED": "Unable to save.<small><br/>Data locked on server. Please retry later</small>",
471
471
  "DATA_NOT_FOUND": "Data not found",
472
+ "DOWNLOAD_FAILED": "Download failed: {{error}}",
472
473
  "LOAD_ACCOUNT_ERROR": "Error loading user account.<small><br/>If the problem persists, please contact your administrator.</small>",
473
474
  "SAVE_ACCOUNT_ERROR": "Error saving your account.<small><br/>If the problem persists, please contact your administrator.</small>",
474
475
  "LOAD_CONFIG_ERROR": "Error while loading configuration",
@@ -527,6 +528,7 @@
527
528
  "SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?"
528
529
  },
529
530
  "INFO": {
531
+ "ALERT_HEADER": "Information",
530
532
  "SYNCHRONIZATION_SUCCEED": "Synchronization completed! <br/> The data has been received by the server.",
531
533
  "DEBUG_DATA_SEND": "Help request sent to administrator",
532
534
  "DATA_MIGRATION_STARTED": "Data recovery in progress. <br/><b>Please wait ...</b>",
@@ -536,6 +538,7 @@
536
538
  "UPDATE_APP": "<b>Please upgrade {{name}}</b>",
537
539
  "UPDATE_APP_TO_VERSION": "<b>Please upgrade {{name}}</b> in version {{version}} (or more)",
538
540
  "UPDATE_APP_HELP": "If you do not do this upgrade, communication with the network node may not work.",
541
+ "UPDATE_APP_DOWNLOADED": "The update download is complete.<br/><b>Please install</b> from the downloaded files.",
539
542
  "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters"
540
543
  },
541
544
  "TABLE": {
@@ -543,6 +546,7 @@
543
546
  "SEARCH_TEXT": "Search: code, name",
544
547
  "LABEL": "Code",
545
548
  "NAME": "Name",
549
+ "LEVEL_ID": "Level",
546
550
  "CREATION_DATE": "Creation date",
547
551
  "UPDATE_DATE": "Update date",
548
552
  "COMMENTS": "Comments",
@@ -469,6 +469,7 @@
469
469
  "BAD_UPDATE_DATE": "Unable to save.<small><br/>Concurrent change detected. Please reload this page and retry.</small>",
470
470
  "DATA_LOCKED": "Unable to save.<small><br/>Data locked on server. Please retry later</small>",
471
471
  "DATA_NOT_FOUND": "Data not found",
472
+ "DOWNLOAD_FAILED": "Download failed: {{error}}",
472
473
  "LOAD_ACCOUNT_ERROR": "Error loading user account.<small><br/>If the problem persists, please contact your administrator.</small>",
473
474
  "SAVE_ACCOUNT_ERROR": "Error saving your account.<small><br/>If the problem persists, please contact your administrator.</small>",
474
475
  "LOAD_CONFIG_ERROR": "Error while loading configuration",
@@ -527,6 +528,7 @@
527
528
  "SEND_DEBUG_DATA": "Do you want to send this data to the administrator for help?"
528
529
  },
529
530
  "INFO": {
531
+ "ALERT_HEADER": "Information",
530
532
  "SYNCHRONIZATION_SUCCEED": "Synchronization completed! <br/> The data has been received by the server.",
531
533
  "DEBUG_DATA_SEND": "Help request sent to administrator",
532
534
  "DATA_MIGRATION_STARTED": "Data recovery in progress. <br/><b>Please wait ...</b>",
@@ -536,6 +538,7 @@
536
538
  "UPDATE_APP": "<b>Please upgrade {{name}}</b>",
537
539
  "UPDATE_APP_TO_VERSION": "<b>Please upgrade {{name}}</b> in version {{version}} (or more)",
538
540
  "UPDATE_APP_HELP": "If you do not do this upgrade, communication with the network node may not work.",
541
+ "UPDATE_APP_DOWNLOADED": "The update download is complete.<br/><b>Please install</b> from the downloaded files.",
539
542
  "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters"
540
543
  },
541
544
  "TABLE": {
@@ -543,6 +546,7 @@
543
546
  "SEARCH_TEXT": "Search: code, name",
544
547
  "LABEL": "Code",
545
548
  "NAME": "Name",
549
+ "LEVEL_ID": "Level",
546
550
  "CREATION_DATE": "Creation date",
547
551
  "UPDATE_DATE": "Update date",
548
552
  "COMMENTS": "Comments",
@@ -21,6 +21,4 @@ mat-icon > span {
21
21
  margin-left: -6px;
22
22
  }
23
23
 
24
-
25
-
26
24
  @include set-color-each-ion-colors('mat-icon');
@@ -43,3 +43,10 @@ ion-icon[slot] {
43
43
  width: 24px;
44
44
  height: 24px;
45
45
  }
46
+
47
+ /* hide icon SVG title */
48
+ ion-icon {
49
+ .icon-inner, .ionicon, svg {
50
+ pointer-events: none !important;
51
+ }
52
+ }