@sumaris-net/ngx-components 1.9.7 → 1.10.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.
Files changed (48) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +100 -20
  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 +2 -2
  6. package/esm2015/src/app/core/form/editor.class.js +2 -2
  7. package/esm2015/src/app/core/graphql/graphql.service.js +4 -4
  8. package/esm2015/src/app/core/home/home.js +2 -2
  9. package/esm2015/src/app/core/install/install-upgrade-card.component.js +2 -2
  10. package/esm2015/src/app/core/services/account.service.js +8 -4
  11. package/esm2015/src/app/core/services/config.service.js +2 -2
  12. package/esm2015/src/app/core/services/network.service.js +5 -5
  13. package/esm2015/src/app/core/services/platform.service.js +3 -4
  14. package/esm2015/src/app/core/services/testing/referential-filter.model.js +23 -0
  15. package/esm2015/src/app/core/services/testing/referential.validator.js +44 -0
  16. package/esm2015/src/app/core/table/table.class.js +2 -2
  17. package/esm2015/src/app/shared/services/startable-service.class.js +4 -1
  18. package/esm2015/src/app/shared/shared.testing.module.js +9 -3
  19. package/esm2015/src/app/shared/toast/toast.testing.js +39 -0
  20. package/esm2015/src/app/shared/toast/toast.testing.module.js +33 -0
  21. package/esm2015/src/app/shared/toast/toasts.js +119 -0
  22. package/esm2015/src/app/social/services/user-event.service.js +2 -2
  23. package/esm2015/sumaris-net.ngx-components.js +9 -7
  24. package/fesm2015/sumaris-net.ngx-components.js +88 -15
  25. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  26. package/package.json +1 -1
  27. package/public_api.d.ts +1 -1
  28. package/src/app/core/form/editor.class.d.ts +1 -1
  29. package/src/app/core/home/home.d.ts +1 -1
  30. package/src/app/core/services/account.service.d.ts +4 -2
  31. package/src/app/core/services/config.service.d.ts +1 -1
  32. package/src/app/core/services/network.service.d.ts +1 -1
  33. package/src/app/core/services/platform.service.d.ts +1 -1
  34. package/src/app/core/services/testing/referential-filter.model.d.ts +9 -0
  35. package/src/app/core/services/testing/referential.validator.d.ts +19 -0
  36. package/src/app/core/table/table.class.d.ts +1 -1
  37. package/src/app/shared/services/startable-service.class.d.ts +1 -0
  38. package/src/app/shared/shared.testing.module.d.ts +2 -0
  39. package/src/app/shared/toast/toast.testing.d.ts +14 -0
  40. package/src/app/shared/toast/toast.testing.module.d.ts +2 -0
  41. package/src/app/shared/{toasts.d.ts → toast/toasts.d.ts} +0 -0
  42. package/src/app/social/services/user-event.service.d.ts +1 -1
  43. package/src/assets/i18n/en-US.json +4 -1
  44. package/src/assets/i18n/en.json +4 -1
  45. package/src/assets/i18n/fr.json +4 -1
  46. package/sumaris-net.ngx-components.d.ts +8 -6
  47. package/sumaris-net.ngx-components.metadata.json +1 -1
  48. package/esm2015/src/app/shared/toasts.js +0 -119
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.9.7",
4
+ "version": "1.10.0",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -35,7 +35,7 @@ export * from './src/app/shared/form/field.model';
35
35
  export * from './src/app/shared/toolbar/toolbar';
36
36
  export * from './src/app/shared/toolbar/modal-toolbar';
37
37
  export * from './src/app/shared/interceptors/progess.interceptor';
38
- export * from './src/app/shared/toasts';
38
+ export * from './src/app/shared/toast/toasts';
39
39
  export * from './src/app/shared/help/help.modal';
40
40
  export * from './src/app/shared/guard/component-dirty.guard';
41
41
  export * from './src/app/shared/directives/directives.module';
@@ -8,7 +8,7 @@ import { AppTable } from '../table/table.class';
8
8
  import { AppForm } from './form.class';
9
9
  import { FormButtonsBarToken } from './form-buttons-bar.component';
10
10
  import { IAppForm, IAppFormGetter } from './form.utils';
11
- import { ShowToastOptions } from '../../shared/toasts';
11
+ import { ShowToastOptions } from '../../shared/toast/toasts';
12
12
  import { HammerSwipeEvent } from '../../shared/gesture/hammer.utils';
13
13
  import { ToolbarToken } from '../../shared/toolbar/toolbar';
14
14
  import { CanLeave } from '../../shared/guard/component-dirty.guard';
@@ -12,7 +12,7 @@ import { PlatformService } from '../services/platform.service';
12
12
  import { LocalSettingsService } from '../services/local-settings.service';
13
13
  import { NetworkService } from '../services/network.service';
14
14
  import { MenuItem } from '../menu/menu.model';
15
- import { ShowToastOptions } from '../../shared/toasts';
15
+ import { ShowToastOptions } from '../../shared/toast/toasts';
16
16
  import { HistoryPageReference } from '../services/model/history.model';
17
17
  export declare function getRandomImage(files: String[]): String;
18
18
  export declare const APP_HOME_BUTTONS: InjectionToken<MenuItem[]>;
@@ -13,7 +13,7 @@ import { FormFieldDefinition } from '../../shared/form/field.model';
13
13
  import { AuthTokenType, NetworkService } from './network.service';
14
14
  import { FileService } from '../../shared/file/file.service';
15
15
  import { Referential } from './model/referential.model';
16
- import { ShowToastOptions } from '../../shared/toasts';
16
+ import { ShowToastOptions } from '../../shared/toast/toasts';
17
17
  import { OverlayEventDetail } from '@ionic/core';
18
18
  import { ToastController } from '@ionic/angular';
19
19
  import { TranslateService } from '@ngx-translate/core';
@@ -88,7 +88,9 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
88
88
  register(data: RegisterData): Promise<Account>;
89
89
  authenticate(data?: AuthData): Promise<void>;
90
90
  login(data: AuthData): Promise<Account>;
91
- reload(): Promise<Account>;
91
+ reload(opts?: {
92
+ showToast?: boolean;
93
+ }): Promise<Account>;
92
94
  /**
93
95
  * Create or update an user account, to the remote storage
94
96
  *
@@ -7,7 +7,7 @@ import { FormFieldDefinition, FormFieldDefinitionMap } from '../../shared/form/f
7
7
  import { FileService } from '../../shared/file/file.service';
8
8
  import { NetworkService } from './network.service';
9
9
  import { Platform, ToastController } from '@ionic/angular';
10
- import { ShowToastOptions } from '../../shared/toasts';
10
+ import { ShowToastOptions } from '../../shared/toast/toasts';
11
11
  import { TranslateService } from '@ngx-translate/core';
12
12
  import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
13
13
  import { BaseGraphqlService } from './base-graphql-service.class';
@@ -10,7 +10,7 @@ import { SplashScreen } from '@ionic-native/splash-screen/ngx';
10
10
  import { HttpClient, HttpHeaders } from '@angular/common/http';
11
11
  import { Connection, Network } from '@ionic-native/network/ngx';
12
12
  import { CacheService } from 'ionic-cache';
13
- import { ShowToastOptions } from '../../shared/toasts';
13
+ import { ShowToastOptions } from '../../shared/toast/toasts';
14
14
  import { OverlayEventDetail } from '@ionic/core';
15
15
  import { NodeInfo } from './network.utils';
16
16
  import { StartableService } from '../../shared/services/startable-service.class';
@@ -12,7 +12,7 @@ import { Platform as CdkPlatform } from '@angular/cdk/platform';
12
12
  import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
13
13
  import { Storage } from '@ionic/storage';
14
14
  import { EntitiesStorage } from './storage/entities-storage.service';
15
- import { ShowToastOptions } from '../../shared/toasts';
15
+ import { ShowToastOptions } from '../../shared/toast/toasts';
16
16
  import { TranslateService } from '@ngx-translate/core';
17
17
  import { AccountService } from './account.service';
18
18
  import { Observable } from 'rxjs';
@@ -0,0 +1,9 @@
1
+ import { EntityFilter } from '../model/filter.model';
2
+ import { Referential } from '../model/referential.model';
3
+ import { FilterFn } from '../../../shared/services/entity-service.class';
4
+ export declare class ReferentialFilter extends EntityFilter<ReferentialFilter, Referential> {
5
+ static fromObject: (source: any, opts?: any) => ReferentialFilter;
6
+ searchText: string;
7
+ fromObject(source: any, opts?: any): void;
8
+ protected buildFilter(): FilterFn<Referential>[];
9
+ }
@@ -0,0 +1,19 @@
1
+ import { AbstractControlOptions, FormBuilder, FormGroup } from '@angular/forms';
2
+ import { Referential } from '../model/referential.model';
3
+ import { AppValidatorService } from '../validator/base.validator.class';
4
+ export declare class ReferentialValidatorService<T extends Referential = Referential> extends AppValidatorService<T> {
5
+ protected formBuilder: FormBuilder;
6
+ constructor(formBuilder: FormBuilder);
7
+ getRowValidator(): FormGroup;
8
+ getFormGroup(data?: T, opts?: {
9
+ withDescription?: boolean;
10
+ withComments?: boolean;
11
+ }): FormGroup;
12
+ getFormGroupConfig(data?: T, opts?: {
13
+ withDescription?: boolean;
14
+ withComments?: boolean;
15
+ }): {
16
+ [key: string]: any;
17
+ };
18
+ getFormGroupOptions(data?: T, opts?: any): AbstractControlOptions | null;
19
+ }
@@ -17,7 +17,7 @@ import { TranslateService } from '@ngx-translate/core';
17
17
  import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete';
18
18
  import { CompletableEvent } from '../../shared/events';
19
19
  import { WaitForOptions } from '../../shared/observables';
20
- import { ShowToastOptions } from '../../shared/toasts';
20
+ import { ShowToastOptions } from '../../shared/toast/toasts';
21
21
  import { CdkColumnDef } from '@angular/cdk/table';
22
22
  import { LoadResult } from '../../shared/services/entity-service.class';
23
23
  import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
@@ -24,6 +24,7 @@ export declare abstract class StartableService<T = any> implements IStartableSer
24
24
  get starting(): boolean;
25
25
  ready(): Promise<T>;
26
26
  protected registerSubscription(sub: Subscription): Subscription;
27
+ protected unregisterSubscription(sub: Subscription): void;
27
28
  protected ngOnStop(): Promise<void>;
28
29
  protected abstract ngOnStart(): Promise<T>;
29
30
  }
@@ -1,2 +1,4 @@
1
+ import { TestingPage } from './material/testing/material.testing.page';
2
+ export declare const SHARED_TESTING_PAGES: TestingPage[];
1
3
  export declare class SharedTestingModule {
2
4
  }
@@ -0,0 +1,14 @@
1
+ import { ToastController } from '@ionic/angular';
2
+ import { ShowToastOptions } from './toasts';
3
+ import { TranslateService } from '@ngx-translate/core';
4
+ export declare class ToastTestingPage {
5
+ private toastController;
6
+ private translate;
7
+ readonly defaultOptions: ShowToastOptions;
8
+ constructor(toastController: ToastController, translate: TranslateService);
9
+ showToast(opts?: ShowToastOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
10
+ showInfo(opts?: ShowToastOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
11
+ showWarning(opts?: ShowToastOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
12
+ showError(opts?: ShowToastOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
13
+ toggleCloseButton(): void;
14
+ }
@@ -0,0 +1,2 @@
1
+ export declare class ToastTestingModule {
2
+ }
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
4
4
  import { UserEvent, UserEventAction } from './model/user-event.model';
5
5
  import { SortDirection } from '@angular/material/sort';
6
6
  import { EntitiesServiceWatchOptions, EntityServiceLoadOptions, FilterFn, IEntitiesService, LoadResult, Page } from '../../shared/services/entity-service.class';
7
- import { ShowToastOptions } from '../../shared/toasts';
7
+ import { ShowToastOptions } from '../../shared/toast/toasts';
8
8
  import { OverlayEventDetail } from '@ionic/core';
9
9
  import { ToastController } from '@ionic/angular';
10
10
  import { TranslateService } from '@ngx-translate/core';
@@ -282,8 +282,11 @@
282
282
  "LOCALE": "Language",
283
283
  "LAT_LONG_FORMAT": "Latitude/longitude format"
284
284
  },
285
+ "INFO": {
286
+ "RELOADED": "Your user account has been updated!"
287
+ },
285
288
  "ERROR": {
286
- "SUBSCRIBE_ACCOUNT_ERROR": "Error while listening account's changes."
289
+ "SUBSCRIBE_ERROR": "Error while listening account's changes."
287
290
  }
288
291
  },
289
292
  "SETTINGS": {
@@ -282,8 +282,11 @@
282
282
  "LOCALE": "Language",
283
283
  "LAT_LONG_FORMAT": "Latitude/longitude format"
284
284
  },
285
+ "INFO": {
286
+ "RELOADED": "Your user account has been updated!"
287
+ },
285
288
  "ERROR": {
286
- "SUBSCRIBE_ACCOUNT_ERROR": "Error while listening account's changes."
289
+ "SUBSCRIBE_ERROR": "Error while listening account's changes."
287
290
  }
288
291
  },
289
292
  "SETTINGS": {
@@ -279,8 +279,11 @@
279
279
  "LOCALE": "Langue",
280
280
  "LAT_LONG_FORMAT": "Format latitude/longitude"
281
281
  },
282
+ "INFO": {
283
+ "RELOADED": "Votre compte utilisateur a été actualisé !"
284
+ },
282
285
  "ERROR": {
283
- "SUBSCRIBE_ACCOUNT_ERROR": "Échec de l'abonnement distant au compte utilisateur."
286
+ "SUBSCRIBE_ERROR": "Échec de l'abonnement distant au compte utilisateur."
284
287
  }
285
288
  },
286
289
  "SETTINGS": {
@@ -2,15 +2,17 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './public_api';
5
- export { AppIconComponent as ɵl } from './src/app/core/icon/icon.component';
6
- export { RegisterForm as ɵg } from './src/app/core/register/form/form-register';
7
- export { RegisterModal as ɵi } from './src/app/core/register/modal/modal-register';
8
- export { AccountValidatorService as ɵh } from './src/app/core/services/validator/account.validator';
9
- export { LocalSettingsValidatorService as ɵk } from './src/app/core/services/validator/local-settings.validator';
10
- export { UserSettingsValidatorService as ɵj } from './src/app/core/services/validator/user-settings.validator';
5
+ export { AppIconComponent as ɵn } from './src/app/core/icon/icon.component';
6
+ export { RegisterForm as ɵi } from './src/app/core/register/form/form-register';
7
+ export { RegisterModal as ɵk } from './src/app/core/register/modal/modal-register';
8
+ export { AccountValidatorService as ɵj } from './src/app/core/services/validator/account.validator';
9
+ export { LocalSettingsValidatorService as ɵm } from './src/app/core/services/validator/local-settings.validator';
10
+ export { UserSettingsValidatorService as ɵl } from './src/app/core/services/validator/user-settings.validator';
11
11
  export { isFocusableElement as ɵe } from './src/app/shared/focusable';
12
12
  export { MatBadgeIconDirective as ɵd } from './src/app/shared/material/badge/badge-icon.directive';
13
13
  export { SharedMatBadgeIconModule as ɵc } from './src/app/shared/material/badge/badge-icon.module';
14
14
  export { MatBadgeIconTestPage as ɵf } from './src/app/shared/material/badge/badge-icon.test';
15
15
  export { MatNumpadDomService as ɵb } from './src/app/shared/material/numpad/numpad.dom-service';
16
16
  export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.module';
17
+ export { ToastTestingPage as ɵh } from './src/app/shared/toast/toast.testing';
18
+ export { ToastTestingModule as ɵg } from './src/app/shared/toast/toast.testing.module';