@sumaris-net/ngx-components 1.9.9 → 1.10.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.
Files changed (46) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +143 -67
  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/doc/changelog.md +4 -0
  6. package/esm2015/public_api.js +2 -2
  7. package/esm2015/src/app/core/form/editor.class.js +2 -2
  8. package/esm2015/src/app/core/form/entity-editor.class.js +17 -15
  9. package/esm2015/src/app/core/home/home.js +2 -2
  10. package/esm2015/src/app/core/install/install-upgrade-card.component.js +2 -2
  11. package/esm2015/src/app/core/services/account.service.js +22 -25
  12. package/esm2015/src/app/core/services/base-entity-service.class.js +3 -3
  13. package/esm2015/src/app/core/services/config.service.js +2 -2
  14. package/esm2015/src/app/core/services/network.service.js +5 -5
  15. package/esm2015/src/app/core/services/platform.service.js +3 -4
  16. package/esm2015/src/app/core/services/testing/referential-filter.model.js +23 -0
  17. package/esm2015/src/app/core/services/testing/referential.validator.js +44 -0
  18. package/esm2015/src/app/core/table/table.class.js +32 -20
  19. package/esm2015/src/app/shared/shared.testing.module.js +9 -3
  20. package/esm2015/src/app/shared/toast/toast.testing.js +39 -0
  21. package/esm2015/src/app/shared/toast/toast.testing.module.js +33 -0
  22. package/esm2015/src/app/shared/toast/toasts.js +119 -0
  23. package/esm2015/src/app/social/services/user-event.service.js +2 -2
  24. package/esm2015/sumaris-net.ngx-components.js +9 -7
  25. package/fesm2015/sumaris-net.ngx-components.js +140 -63
  26. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  27. package/package.json +1 -1
  28. package/public_api.d.ts +1 -1
  29. package/src/app/core/form/editor.class.d.ts +1 -1
  30. package/src/app/core/form/entity-editor.class.d.ts +9 -5
  31. package/src/app/core/home/home.d.ts +1 -1
  32. package/src/app/core/services/account.service.d.ts +4 -3
  33. package/src/app/core/services/config.service.d.ts +1 -1
  34. package/src/app/core/services/network.service.d.ts +1 -1
  35. package/src/app/core/services/platform.service.d.ts +1 -1
  36. package/src/app/core/services/testing/referential-filter.model.d.ts +9 -0
  37. package/src/app/core/services/testing/referential.validator.d.ts +19 -0
  38. package/src/app/core/table/table.class.d.ts +1 -1
  39. package/src/app/shared/shared.testing.module.d.ts +2 -0
  40. package/src/app/shared/toast/toast.testing.d.ts +14 -0
  41. package/src/app/shared/toast/toast.testing.module.d.ts +2 -0
  42. package/src/app/shared/{toasts.d.ts → toast/toasts.d.ts} +0 -0
  43. package/src/app/social/services/user-event.service.d.ts +1 -1
  44. package/sumaris-net.ngx-components.d.ts +8 -6
  45. package/sumaris-net.ngx-components.metadata.json +1 -1
  46. 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.9",
4
+ "version": "1.10.2",
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';
@@ -1,5 +1,5 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
2
- import { Subject, Subscription } from 'rxjs';
2
+ import { Subject } from 'rxjs';
3
3
  import { AddToPageHistoryOptions, LocalSettingsService } from '../services/local-settings.service';
4
4
  import { Entity } from '../services/model/entity.model';
5
5
  import { UsageMode } from '../services/model/settings.model';
@@ -8,6 +8,7 @@ import { AppTabEditor, AppTabEditorOptions } from './editor.class';
8
8
  import { FormErrors } from './form.utils';
9
9
  import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
10
10
  import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
11
+ import { Environment } from '../../../environments/environment.class';
11
12
  import { HistoryPageReference } from '../services/model/history.model';
12
13
  import { WaitForOptions } from '../../shared/observables';
13
14
  import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.class';
@@ -16,6 +17,7 @@ export declare class AppEditorOptions extends AppTabEditorOptions {
16
17
  autoLoadDelay?: number;
17
18
  pathIdAttribute?: string;
18
19
  enableListenChanges?: boolean;
20
+ listenIntervalInSeconds?: number;
19
21
  /**
20
22
  * Change page route (window URL) when saving for the first time
21
23
  */
@@ -40,18 +42,20 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
40
42
  protected dataService?: S;
41
43
  private _usageMode;
42
44
  private readonly _enableListenChanges;
45
+ private readonly _listenIntervalInSeconds;
43
46
  private readonly _pathIdAttribute;
44
47
  private readonly _autoLoad;
45
48
  private readonly _autoLoadDelay;
46
49
  private readonly _autoUpdateRoute;
47
50
  private _autoOpenNextTab;
48
- protected dateFormat: DateFormatPipe;
49
- protected cd: ChangeDetectorRef;
50
- protected settings: LocalSettingsService;
51
+ private _listenChangesSubscription;
52
+ protected readonly dateFormat: DateFormatPipe;
53
+ protected readonly cd: ChangeDetectorRef;
54
+ protected readonly settings: LocalSettingsService;
51
55
  protected errorTranslator: FormErrorTranslator;
56
+ protected readonly environement: Environment;
52
57
  data: T;
53
58
  saving: boolean;
54
- listenRemoteSubscription: Subscription;
55
59
  defaultBackHref: string;
56
60
  historyIcon: {
57
61
  icon?: string;
@@ -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';
@@ -59,6 +59,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
59
59
  onAuthBasicChange: Subject<string>;
60
60
  private _listenChangesSubscription;
61
61
  private readonly _enableListenChanges;
62
+ private readonly _listenIntervalInSeconds;
62
63
  private _cache;
63
64
  private _$additionalFields;
64
65
  private _tokenType$;
@@ -153,8 +154,8 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
153
154
  */
154
155
  protected saveSettingsRemotely(settings: UserSettings): Promise<void>;
155
156
  protected authenticateAndGetToken(token?: string, counter?: number): Promise<string>;
156
- protected startListenChanges(opts?: AccountWatchOptions): Subscription;
157
- protected stopListenChanges(): void;
157
+ protected startListenRemoteChanges(opts?: AccountWatchOptions): Subscription;
158
+ protected stopListenRemoteChanges(): void;
158
159
  protected watchChanges(opts?: AccountWatchOptions): Observable<Account>;
159
160
  protected copyIdAndUpdateDate(source: Account | undefined, target: Account): void;
160
161
  protected copyIdAndUpdateDateSettings(source: UserSettings | undefined, target: UserSettings): void;
@@ -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';
@@ -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';
@@ -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';