@sumaris-net/ngx-components 1.21.0-beta13 → 1.21.0-beta16

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": "1.21.0-beta13",
4
+ "version": "1.21.0-beta16",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
- import { BehaviorSubject, Observable } from 'rxjs';
2
+ import { Observable } from 'rxjs';
3
3
  import { PopoverController } from '@ionic/angular';
4
4
  import { IUserEventService } from '../user-event.service';
5
5
  import { IUserEvent, IUserEventFilter } from '../user-event.model';
@@ -12,14 +12,15 @@ export declare class UserEventNotificationComponent implements OnInit, OnDestroy
12
12
  debug: boolean;
13
13
  titleI18n: string;
14
14
  disabled: boolean;
15
- userEventsSubject: BehaviorSubject<IUserEvent<any, string, import("../user-event.model").EventLevel>[]>;
16
15
  get count(): Observable<number>;
17
- private _subscriptions;
16
+ private _listenSubscription;
18
17
  private _logPrefix;
19
18
  private _readEvent;
20
19
  constructor(userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>, accountService: AccountService, popoverController: PopoverController, cd: ChangeDetectorRef);
21
- ngOnInit(): void;
20
+ ngOnInit(): Promise<void>;
22
21
  showList(event: UIEvent): Promise<void>;
23
- protected markForCheck(): void;
24
22
  ngOnDestroy(): void;
23
+ protected onLogin(): Promise<void>;
24
+ protected onLogout(): void;
25
+ protected markForCheck(): void;
25
26
  }
@@ -1,20 +1,27 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { IUserEvent, UserEventAction } from '../user-event.model';
3
- import { Observable, Subject } from 'rxjs';
1
+ import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { IUserEvent, IUserEventFilter, UserEventAction } from '../user-event.model';
3
+ import { BehaviorSubject, Subscription } from 'rxjs';
4
4
  import { PopoverController } from '@ionic/angular';
5
+ import { IUserEventService } from '../user-event.service';
5
6
  export interface UserEventNotificationListOptions {
7
+ debug?: boolean;
6
8
  titleI18n?: string;
7
- userEvents?: Observable<IUserEvent<any>[]>;
8
9
  readEvent?: EventEmitter<IUserEvent<any>>;
9
10
  }
10
- export declare class UserEventNotificationList implements OnInit, UserEventNotificationListOptions {
11
+ export declare class UserEventNotificationList implements OnInit, OnDestroy, UserEventNotificationListOptions {
12
+ protected cd: ChangeDetectorRef;
11
13
  protected popoverController: PopoverController;
14
+ userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>;
15
+ debug: boolean;
12
16
  titleI18n: string;
13
- userEvents: Subject<IUserEvent<any>[]>;
14
17
  readEvent: EventEmitter<IUserEvent<any>>;
15
- constructor(popoverController: PopoverController);
18
+ userEvents: BehaviorSubject<IUserEvent<any, string, import("../user-event.model").EventLevel>[]>;
19
+ protected subscriptions: Subscription;
20
+ constructor(cd: ChangeDetectorRef, popoverController: PopoverController, userEventService: IUserEventService<IUserEvent<any>, IUserEventFilter<any>>);
16
21
  ngOnInit(): void;
22
+ ngOnDestroy(): void;
17
23
  read($event: UIEvent, userEvent: IUserEvent<any>): void;
18
24
  executeAction(action: UserEventAction, userEvent: IUserEvent<any>): void;
19
25
  dismiss(): void;
26
+ protected markForCheck(): void;
20
27
  }
@@ -0,0 +1,37 @@
1
+ import { AbstractUserEventService, UserEventWatchOptions } from '../user-event.service';
2
+ import { IUserEvent, UserEvent, UserEventFilter } from '../user-event.model';
3
+ import { Observable } from 'rxjs';
4
+ import { GraphqlService } from '../../../core/graphql/graphql.service';
5
+ import { AccountService } from '../../../core/services/account.service';
6
+ import { NetworkService } from '../../../core/services/network.service';
7
+ import { TranslateService } from '@ngx-translate/core';
8
+ import { Environment } from '../../../../environments/environment.class';
9
+ import { FetchPolicy } from '@apollo/client/core';
10
+ import { EntityServiceLoadOptions, LoadResult } from '../../../shared/services/entity-service.class';
11
+ import { SortDirection } from '@angular/material/sort';
12
+ export declare class UserEventTestService extends AbstractUserEventService<UserEvent, UserEventFilter> {
13
+ protected graphql: GraphqlService;
14
+ protected accountService: AccountService;
15
+ protected network: NetworkService;
16
+ protected translate: TranslateService;
17
+ protected environment: Environment;
18
+ private userEvents;
19
+ private count$;
20
+ constructor(graphql: GraphqlService, accountService: AccountService, network: NetworkService, translate: TranslateService, environment: Environment);
21
+ fromObject(source: any): UserEvent;
22
+ add(entity: IUserEvent<any>): void;
23
+ get userEventCount(): Observable<number>;
24
+ asFilter(filter: Partial<any>): any;
25
+ count(filter: any, options?: {
26
+ fetchPolicy?: FetchPolicy;
27
+ }): Promise<number>;
28
+ delete(entity: any): Promise<any>;
29
+ deleteAll(data: any[], opts?: any): Promise<any>;
30
+ listenChanges(filter: any, options?: UserEventWatchOptions & {
31
+ interval?: number;
32
+ fetchPolicy?: FetchPolicy;
33
+ }): Observable<any[]>;
34
+ save(entity: any, options?: EntityServiceLoadOptions): Promise<any>;
35
+ saveAll(data: any[], opts?: any): Promise<any[]>;
36
+ watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<any>, options?: UserEventWatchOptions): Observable<LoadResult<any>>;
37
+ }
@@ -28,6 +28,7 @@ export interface IUserEventMutations {
28
28
  }
29
29
  export interface IUserEventSubscriptions {
30
30
  listenChanges: any;
31
+ listenCountChanges?: any;
31
32
  }
32
33
  export interface IUserEventListener<E extends IUserEvent<E>> {
33
34
  accept: (E: any) => boolean;
@@ -40,6 +41,10 @@ export interface IUserEventService<E extends IUserEvent<E>, F extends IUserEvent
40
41
  count(filter: Partial<F>, options?: {
41
42
  fetchPolicy?: FetchPolicy;
42
43
  }): Promise<number>;
44
+ listenCountChanges(filter: Partial<F>, options?: WO & {
45
+ interval?: number;
46
+ fetchPolicy?: FetchPolicy;
47
+ }): Observable<number>;
43
48
  listenChanges(filter: Partial<F>, options?: WO & {
44
49
  interval?: number;
45
50
  fetchPolicy?: FetchPolicy;
@@ -47,6 +52,7 @@ export interface IUserEventService<E extends IUserEvent<E>, F extends IUserEvent
47
52
  save(entity: E, options?: EntityServiceLoadOptions): Promise<E>;
48
53
  delete(entity: E): Promise<any>;
49
54
  markAsRead(entity: E): any;
55
+ registerListener(listener: IUserEventListener<E>): any;
50
56
  }
51
57
  export declare abstract class AbstractUserEventService<E extends IUserEvent<E, any>, F extends IUserEventFilter<E, any>, WO extends UserEventWatchOptions = UserEventWatchOptions> extends BaseGraphqlService<E, F> implements IUserEventService<E, F, WO>, OnDestroy {
52
58
  protected graphql: GraphqlService;
@@ -71,6 +77,10 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E, a
71
77
  count(filter: Partial<F>, options?: {
72
78
  fetchPolicy?: FetchPolicy;
73
79
  }): Promise<number>;
80
+ listenCountChanges(filter: Partial<F>, options?: WO & {
81
+ interval?: number;
82
+ fetchPolicy?: FetchPolicy;
83
+ }): Observable<number>;
74
84
  listenChanges(filter: Partial<F>, options?: WO & {
75
85
  interval?: number;
76
86
  fetchPolicy?: FetchPolicy;
@@ -10,12 +10,13 @@ export { AccountValidatorService as ɵe } from './src/app/core/services/validato
10
10
  export { LocalSettingsValidatorService as ɵh } from './src/app/core/services/validator/local-settings.validator';
11
11
  export { UserSettingsValidatorService as ɵg } from './src/app/core/services/validator/user-settings.validator';
12
12
  export { isFocusableElement as ɵc } from './src/app/shared/focusable';
13
- export { MatBadgeIconTestPage as ɵo } from './src/app/shared/material/badge/badge-icon.test';
14
- export { DateTestPage as ɵm } from './src/app/shared/material/datetime/testing/mat-date.test';
13
+ export { MatBadgeIconTestPage as ɵp } from './src/app/shared/material/badge/badge-icon.test';
14
+ export { DateTestPage as ɵn } from './src/app/shared/material/datetime/testing/mat-date.test';
15
15
  export { MatNumpadDomService as ɵb } from './src/app/shared/material/numpad/numpad.dom-service';
16
- export { NumpadTestPage as ɵn } from './src/app/shared/material/numpad/testing/numpad.test';
16
+ export { NumpadTestPage as ɵo } from './src/app/shared/material/numpad/testing/numpad.test';
17
17
  export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.module';
18
- export { ToastTestingPage as ɵq } from './src/app/shared/toast/toast.testing';
19
- export { ToastTestingModule as ɵp } from './src/app/shared/toast/toast.testing.module';
20
- export { JobProgressionList as ɵl } from './src/app/social/job/progression/job-progression.list';
18
+ export { ToastTestingPage as ɵr } from './src/app/shared/toast/toast.testing';
19
+ export { ToastTestingModule as ɵq } from './src/app/shared/toast/toast.testing.module';
20
+ export { JobProgressionList as ɵm } from './src/app/social/job/progression/job-progression.list';
21
21
  export { UserEventNotificationList as ɵk } from './src/app/social/user-event/notification/user-event-notification.list';
22
+ export { UserEventTestService as ɵl } from './src/app/social/user-event/testing/user-event.testing.service';