@sumaris-net/ngx-components 2.4.119 → 2.4.120

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.4.119",
4
+ "version": "2.4.120",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -51,7 +51,7 @@ export declare class MenuComponent implements OnInit {
51
51
  onLogin(account: Account): Promise<void>;
52
52
  onLogout(skipRedirect?: boolean): Promise<void>;
53
53
  logout(): Promise<void>;
54
- trackByFn(index: number, menu: MenuItem): string;
54
+ trackByFn(index: number, item: MenuItem): string;
55
55
  enable(value: boolean): Promise<void>;
56
56
  open(): Promise<boolean>;
57
57
  close(): Promise<boolean>;
@@ -5,6 +5,7 @@ import { BehaviorSubject } from 'rxjs';
5
5
  import { MenuPathParam } from './menu.service';
6
6
  import { Account } from '../services/model/account.model';
7
7
  export interface MenuItem extends IconRef {
8
+ id?: number;
8
9
  title: string;
9
10
  path?: string;
10
11
  after?: string;
@@ -1,14 +1,13 @@
1
- import { EventEmitter } from '@angular/core';
2
- import { BehaviorSubject, Observable } from 'rxjs';
1
+ import { Observable } from 'rxjs';
3
2
  import { MenuItem } from './menu.model';
4
3
  import { Router } from '@angular/router';
5
- import { StartableService } from '../../shared/services/startable-service.class';
6
4
  import { Environment } from '../../../environments/environment.class';
7
5
  import { PlatformService } from '../services/platform.service';
8
6
  import { AccountService } from '../services/account.service';
9
7
  import { ConfigService } from '../services/config.service';
10
8
  import { Configuration } from '../services/model/config.model';
11
9
  import { Account } from '../services/model/account.model';
10
+ import { StartableObservableService } from '../../shared/services/startable-observable-service.class';
12
11
  import * as i0 from "@angular/core";
13
12
  export declare type SplitPaneShowWhen = boolean | 'lg';
14
13
  export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
@@ -22,19 +21,19 @@ export interface MenuPathParam {
22
21
  [key: string]: string;
23
22
  };
24
23
  }
25
- export declare class MenuService extends StartableService<BehaviorSubject<MenuItem[]>, any> {
24
+ export declare class MenuService extends StartableObservableService<MenuItem[]> {
26
25
  protected platformService: PlatformService;
27
26
  protected configService: ConfigService;
28
27
  protected accountService: AccountService;
29
28
  protected router: Router;
30
29
  protected environment: Environment;
31
- onUpdateMenu: EventEmitter<any>;
32
- get $items(): BehaviorSubject<MenuItem[]>;
33
30
  private _staticItems;
31
+ private _itemCounter;
34
32
  private _logPrefix;
35
33
  private readonly _$opened;
36
34
  private readonly _$splitPaneWhen;
37
35
  private readonly _$enabled;
36
+ private readonly _$listenRoute;
38
37
  constructor(platformService: PlatformService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, staticItems?: MenuItem[]);
39
38
  get opened(): Observable<boolean>;
40
39
  get splitPaneWhen(): Observable<SplitPaneShowWhen>;
@@ -44,10 +43,11 @@ export declare class MenuService extends StartableService<BehaviorSubject<MenuIt
44
43
  toggleSplitPaneWhen(): void;
45
44
  _markAsOpened(): void;
46
45
  _markAsClosed(): void;
47
- addSubMenuItems(newItems: MenuItem[], opts?: AddSubMenuItemsOption): Promise<void>;
48
- protected ngOnStart(): Promise<BehaviorSubject<MenuItem[]>>;
46
+ addSubMenuItems(newItems: MenuItem[], opts?: AddSubMenuItemsOption): Promise<boolean[]>;
47
+ addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): Promise<boolean>;
48
+ protected _addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): boolean;
49
+ protected ngOnStart(): Promise<MenuItem[]>;
49
50
  protected loadMenuItems(config: Configuration, account: Account): Promise<void>;
50
- protected addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): Promise<void>;
51
51
  protected prepareItem(item: MenuItem): MenuItem;
52
52
  protected findExistingItem(item: MenuItem, items?: MenuItem[]): MenuItem;
53
53
  protected findParent(childItem: MenuItem, availableParents?: MenuItem[]): MenuItem;
@@ -1,7 +1,7 @@
1
1
  import { BehaviorSubject, Subject, Subscription } from 'rxjs';
2
2
  import { IStartableService } from './startable-service.class';
3
3
  /**
4
- * Same as StartableService, bu with a dataSubject instead of a simple 'data' property
4
+ * Same as StartableService, but with a dataSubject instead of a simple 'data' property
5
5
  */
6
6
  export declare abstract class StartableObservableService<T = any, O = any> implements IStartableService<T> {
7
7
  readonly dataSubject: BehaviorSubject<T>;