@sumaris-net/ngx-components 2.8.3-beta11 → 2.8.3-beta13

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": "2.8.3-beta11",
4
+ "version": "2.8.3-beta13",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -5,9 +5,9 @@ import { Account } from '../services/model/account.model';
5
5
  import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
6
6
  import { AccountValidatorService } from '../services/validator/account.validator';
7
7
  import { AppForm } from '../form/form.class';
8
+ import { CanLeave } from '../form/form.utils';
8
9
  import { FormFieldDefinition } from '../../shared/form/field.model';
9
10
  import { LocaleConfig } from '../services/model/settings.model';
10
- import { CanLeave } from '../../shared/guard/component-dirty.guard';
11
11
  import { NetworkService } from '../services/network.service';
12
12
  import { MatTabGroup } from '@angular/material/tabs';
13
13
  import { ConfigService } from '../services/config.service';
@@ -57,7 +57,7 @@ export declare class AccountPage extends AppForm<Account> implements OnInit, OnD
57
57
  startListenChanges(): void;
58
58
  stopListenChanges(): void;
59
59
  sendConfirmationEmail(event: MouseEvent): Promise<boolean>;
60
- save(event: any): Promise<boolean>;
60
+ save(event?: Event): Promise<boolean>;
61
61
  enable(opts?: {
62
62
  onlySelf?: boolean;
63
63
  emitEvent?: boolean;
@@ -4,13 +4,12 @@ import { AlertController, IonContent, NavController, ToastController } from '@io
4
4
  import { TranslateService } from '@ngx-translate/core';
5
5
  import { BehaviorSubject } from 'rxjs';
6
6
  import { FormButtonsBarToken } from '../buttons/form-buttons-bar.component';
7
- import { IAppForm, IAppFormGetter } from '../form.utils';
7
+ import { CanLeave, CanSave, IAppForm, IAppFormGetter } from '../form.utils';
8
8
  import { ShowToastOptions } from '../../../shared/toast/toasts';
9
9
  import { ToolbarToken } from '../../../shared/toolbar/toolbar';
10
- import { CanLeave } from '../../../shared/guard/component-dirty.guard';
11
10
  import { AppFormContainer, IAppFormContainer } from '../form-container.class';
12
11
  import * as i0 from "@angular/core";
13
- export interface IAppEditor<T> extends CanLeave, IAppFormContainer<T> {
12
+ export interface IAppEditor<T> extends IAppFormContainer<T>, CanSave, CanLeave {
14
13
  save(event?: Event, options?: any): Promise<boolean>;
15
14
  cancel(event?: Event): Promise<void>;
16
15
  }
@@ -76,9 +76,14 @@ export interface IAppForm<T = any> {
76
76
  emitEvent?: boolean;
77
77
  }): void;
78
78
  }
79
- export interface ICanSaveAppForm<T = any> extends IAppForm {
79
+ export interface CanSave {
80
+ dirty: boolean;
81
+ valid: boolean;
80
82
  save(): Promise<boolean>;
81
83
  }
84
+ export interface CanLeave extends CanSave {
85
+ cancel(event?: Event): Promise<void>;
86
+ }
82
87
  /**
83
88
  * A form that do nothing
84
89
  */
@@ -194,6 +199,7 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
194
199
  onlySelf?: boolean;
195
200
  emitEvent?: boolean;
196
201
  }): void;
202
+ save(): Promise<boolean>;
197
203
  }
198
204
  export interface FormArrayHelperOptions {
199
205
  allowEmptyArray: boolean;
@@ -339,7 +345,7 @@ export declare class AppFormUtils {
339
345
  static updateValueAndValidity: typeof updateValueAndValidity;
340
346
  static getFormErrors: typeof getFormErrors;
341
347
  static isForm(object: any): object is IAppForm;
342
- static isCanSaveForm(object: any): object is ICanSaveAppForm;
348
+ static canSave(object: any): object is IAppForm & CanSave;
343
349
  static addValueInArray: typeof addValueInArray;
344
350
  static removeValueInArray: typeof removeValueInArray;
345
351
  static resizeArray: typeof resizeArray;
@@ -3,7 +3,7 @@ import { AccountService } from '../services/account.service';
3
3
  import { LocaleConfig, LocalSettings, UsageMode } from '../services/model/settings.model';
4
4
  import { UntypedFormArray, UntypedFormBuilder } from '@angular/forms';
5
5
  import { AppForm } from '../form/form.class';
6
- import { FormArrayHelper } from '../form/form.utils';
6
+ import { CanLeave, FormArrayHelper } from '../form/form.utils';
7
7
  import { TranslateService } from '@ngx-translate/core';
8
8
  import { LocalSettingsValidatorService } from '../services/validator/local-settings.validator';
9
9
  import { PlatformService } from '../services/platform.service';
@@ -12,7 +12,6 @@ import { LocalSettingsService } from '../services/local-settings.service';
12
12
  import { FormFieldDefinition, FormFieldDefinitionMap } from '../../shared/form/field.model';
13
13
  import { AlertController, NavController } from '@ionic/angular';
14
14
  import { Property } from '../../shared/types';
15
- import { CanLeave } from '../../shared/guard/component-dirty.guard';
16
15
  import { ISelectPeerModalOptions } from '../peer/select-peer.modal';
17
16
  import { IMenuItem } from '../menu/menu.model';
18
17
  import * as i0 from "@angular/core";
@@ -9,7 +9,7 @@ import { AlertController, ModalController, NavController, ToastController } from
9
9
  import { ActivatedRoute, Router } from '@angular/router';
10
10
  import { ColumnItem } from './table-select-columns.component';
11
11
  import { Location } from '@angular/common';
12
- import { IAppForm } from '../form/form.utils';
12
+ import { CanSave, IAppForm } from '../form/form.utils';
13
13
  import { LocalSettingsService } from '../services/local-settings.service';
14
14
  import { TranslateService } from '@ngx-translate/core';
15
15
  import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
@@ -23,7 +23,7 @@ import { SaveActionType } from './table.model';
23
23
  import { AsyncTableElement } from '@e-is/ngx-material-table';
24
24
  import { EntitiesAsyncTableDataSource } from './entities-async-table-datasource.class';
25
25
  import * as i0 from "@angular/core";
26
- export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, IFormControlPathTranslator {
26
+ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, CanSave, IFormControlPathTranslator {
27
27
  protected columns: string[];
28
28
  protected _dataSource?: EntitiesAsyncTableDataSource<T, F, ID>;
29
29
  private _filter?;
@@ -9,7 +9,7 @@ import { AlertController, ModalController, NavController, ToastController } from
9
9
  import { ActivatedRoute, Router } from '@angular/router';
10
10
  import { ColumnItem } from './table-select-columns.component';
11
11
  import { Location } from '@angular/common';
12
- import { IAppForm } from '../form/form.utils';
12
+ import { CanSave, IAppForm } from '../form/form.utils';
13
13
  import { LocalSettingsService } from '../services/local-settings.service';
14
14
  import { TranslateService } from '@ngx-translate/core';
15
15
  import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
@@ -23,7 +23,7 @@ import { SaveActionType } from './table.model';
23
23
  import { MatPaginator } from '@angular/material/paginator';
24
24
  import { MatTable } from '@angular/material/table';
25
25
  import * as i0 from "@angular/core";
26
- export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, IFormControlPathTranslator {
26
+ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, CanSave, IFormControlPathTranslator {
27
27
  protected columns: string[];
28
28
  protected _dataSource?: EntitiesTableDataSource<T, F, ID>;
29
29
  private _filter?;
@@ -1,13 +1,8 @@
1
1
  import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot, UrlTree } from '@angular/router';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { AlertController } from '@ionic/angular';
4
+ import { CanLeave } from '../../core/form/form.utils';
4
5
  import * as i0 from "@angular/core";
5
- export interface CanLeave {
6
- dirty: boolean;
7
- valid: boolean;
8
- save(event?: Event, options?: any): Promise<boolean>;
9
- cancel(event?: Event): Promise<void>;
10
- }
11
6
  export declare class ComponentDirtyGuard implements CanDeactivate<CanLeave> {
12
7
  protected translate: TranslateService;
13
8
  protected alertCtrl: AlertController;
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "2.8.3-beta11",
5
+ "version": "2.8.3-beta13",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{