@sumaris-net/ngx-components 0.25.9 → 0.25.13

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/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.9",
4
+ "version": "0.25.13",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -56,6 +56,7 @@ export * from './src/app/shared/pipes/maps.pipe';
56
56
  export * from './src/app/shared/pipes/string.pipes';
57
57
  export * from './src/app/shared/pipes/translate-context.pipe';
58
58
  export * from './src/app/shared/pipes/ng-init.pipe';
59
+ export * from './src/app/shared/pipes/form.pipes';
59
60
  export * from './src/app/shared/audio/audio';
60
61
  export * from './src/app/shared/file/file.service';
61
62
  export * from './src/app/shared/services/startable-service.class';
@@ -64,6 +65,7 @@ export * from './src/app/shared/services/memory-entity-service.class';
64
65
  export * from './src/app/shared/services/progress-bar.service';
65
66
  export * from './src/app/shared/services/translate-context.service';
66
67
  export * from './src/app/shared/services/job.utils';
68
+ export * from './src/app/shared/validator/form-error-adapter.class';
67
69
  export * from './src/app/shared/types';
68
70
  export * from './src/app/shared/dates';
69
71
  export * from './src/app/shared/functions';
@@ -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;
57
+ private listenDownloadJobs;
58
58
  private listenDownloadJob;
59
59
  private showDownloadFailedToast;
60
60
  private showDownloadCompleteDialog;
61
+ private markForCheck;
62
+ private showToast;
61
63
  }
@@ -20,6 +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 { FormErrorAdapter, IFormPathTranslateService } from '../../shared/validator/form-error-adapter.class';
23
24
  export declare const SETTINGS_DISPLAY_COLUMNS = "displayColumns";
24
25
  export declare const SETTINGS_SORTED_COLUMN = "sortedColumn";
25
26
  export declare const SETTINGS_FILTER = "filter";
@@ -42,7 +43,7 @@ export interface IModalDetailOptions<T = any> {
42
43
  onDelete: (event: UIEvent, data: T) => Promise<boolean>;
43
44
  }
44
45
  export declare type SaveActionType = 'delete' | 'sort' | 'filter';
45
- export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm {
46
+ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, IFormPathTranslateService {
46
47
  protected route: ActivatedRoute;
47
48
  protected router: Router;
48
49
  protected platform: Platform | PlatformService;
@@ -54,7 +55,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
54
55
  private _filter?;
55
56
  private _initialized;
56
57
  private _subscription;
57
- private _dataSourceloadingSubscription;
58
+ private _dataSourceLoadingSubscription;
58
59
  private _cellValueChangesDefs;
59
60
  protected _enabled: boolean;
60
61
  protected _destroy$: Subject<unknown>;
@@ -64,6 +65,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
64
65
  protected alertCtrl: AlertController;
65
66
  protected toastController: ToastController;
66
67
  protected previouslyEditedRowId: number;
68
+ protected formErrorAdapter: FormErrorAdapter;
67
69
  excludesColumns: string[];
68
70
  displayedColumns: string[];
69
71
  totalRowCount: number | null;
@@ -288,6 +290,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
288
290
  doRefresh(event?: CompletableEvent): void;
289
291
  getCurrentColumns(): ColumnItem[];
290
292
  escapeEditingRow(event?: Event, row?: TableElement<T>): void;
293
+ translateFormControlPath(path: string): string;
291
294
  protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
292
295
  focusColumn?: string;
293
296
  }): boolean;
@@ -353,8 +356,6 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
353
356
  separator?: string;
354
357
  recursive?: boolean;
355
358
  }): string;
356
- protected getI18nFieldName(fieldName: string): string;
357
- protected getI18nError(errorKey: string, errorContent?: any): string;
358
359
  protected setError(value: string, opts?: {
359
360
  emitEvent?: boolean;
360
361
  }): void;
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { FormErrorAdapter, FormErrorAdapterOptions } from '../validator/form-error-adapter.class';
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,22 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { FormGroup } from '@angular/forms';
4
+ import { ObjectMap } from '../types';
5
+ export declare const APP_FORM_ERROR_I18N_KEYS: InjectionToken<ObjectMap<string>>;
6
+ export interface IFormPathTranslateService {
7
+ translateFormControlPath: (controlPath: string) => string;
8
+ }
9
+ export interface FormErrorAdapterOptions {
10
+ i18nPrefix?: string;
11
+ pathTranslateService?: IFormPathTranslateService;
12
+ separator?: string;
13
+ recursive?: boolean;
14
+ }
15
+ export declare class FormErrorAdapter implements IFormPathTranslateService {
16
+ private translate;
17
+ private readonly errorI18nKeys;
18
+ constructor(translate: TranslateService, errorI18nKeys: ObjectMap<string>);
19
+ translateFormErrors(form: FormGroup, opts?: FormErrorAdapterOptions): string;
20
+ translateFormControlPath(path: string, opts?: FormErrorAdapterOptions): string;
21
+ translateError(errorKey: string, errorContent?: any): any;
22
+ }
@@ -1,7 +1,7 @@
1
1
  import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from '@angular/forms';
2
2
  import { Moment, unitOfTime } from 'moment';
3
3
  export declare class SharedValidators {
4
- static I18N_ERROR_KEYS: {
4
+ static readonly I18N_ERROR_KEYS: {
5
5
  required: string;
6
6
  min: string;
7
7
  max: string;
@@ -37,8 +37,6 @@ export declare class SharedValidators {
37
37
  static dateRangeStart(endDateFieldName: string, msg?: string): ValidatorFn;
38
38
  static copyParentErrors(errorNames?: string[]): ValidatorFn;
39
39
  static clearError(control: AbstractControl, errorCode: string): void;
40
- static translateError(translateFn: (key: string, obj?: any) => string, errorKey: string, errorContent?: any): string;
41
- static translateErrorKey(): void;
42
40
  }
43
41
  export declare class SharedFormGroupValidators {
44
42
  static dateRange(startDateField: string, endDateField: string, msg?: string): ValidatorFn;
@@ -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');