@sumaris-net/ngx-components 2.4.134 → 2.4.135

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.134",
4
+ "version": "2.4.135",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -10,6 +10,7 @@ import { PersonFilter } from '../services/filter/person.filter';
10
10
  import { ConfigService } from '../../core/services/config.service';
11
11
  import { MatExpansionPanel } from '@angular/material/expansion';
12
12
  import { MessageService } from '../../social/message/message.service';
13
+ import { MenuService } from '../../core/menu/menu.service';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class UsersPage extends AppTable<Person, PersonFilter> implements OnInit {
15
16
  protected accountService: AccountService;
@@ -17,6 +18,7 @@ export declare class UsersPage extends AppTable<Person, PersonFilter> implements
17
18
  protected configService: ConfigService;
18
19
  protected dataService: PersonService;
19
20
  protected messageService: MessageService;
21
+ protected menuService: MenuService;
20
22
  protected cd: ChangeDetectorRef;
21
23
  readonly canEdit: boolean;
22
24
  readonly canSendMessage: boolean;
@@ -29,10 +31,10 @@ export declare class UsersPage extends AppTable<Person, PersonFilter> implements
29
31
  set showUsernameColumn(value: boolean);
30
32
  set showUsernameExtranetColumn(value: boolean);
31
33
  useSticky: boolean;
32
- constructor(injector: Injector, formBuilder: UntypedFormBuilder, accountService: AccountService, validatorService: ValidatorService, configService: ConfigService, dataService: PersonService, messageService: MessageService, cd: ChangeDetectorRef, environment: any);
34
+ constructor(injector: Injector, formBuilder: UntypedFormBuilder, accountService: AccountService, validatorService: ValidatorService, configService: ConfigService, dataService: PersonService, messageService: MessageService, menuService: MenuService, cd: ChangeDetectorRef, environment: any);
33
35
  filterExpansionPanel: MatExpansionPanel;
34
36
  get firstUserColumn(): string;
35
- ngOnInit(): void;
37
+ ngOnInit(): Promise<void>;
36
38
  applyFilterAndClosePanel(event?: Event): void;
37
39
  resetFilter(event?: Event): void;
38
40
  protected restoreFilterOrLoad(): Promise<void>;
@@ -1,16 +1,14 @@
1
- import { ChangeDetectorRef, InjectionToken, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
2
2
  import { AlertController, IonSplitPane, MenuController, ModalController, NavController } from '@ionic/angular';
3
3
  import { Account } from '../services/model/account.model';
4
4
  import { AccountService } from '../services/account.service';
5
5
  import { TranslateService } from '@ngx-translate/core';
6
6
  import { PlatformService } from '../services/platform.service';
7
7
  import { MenuService, SplitPaneShowWhen } from './menu.service';
8
- import { IMenuItem, MenuOptions } from './menu.model';
8
+ import { IMenuItem } from './menu.model';
9
9
  import { ActivatedRoute, Router } from '@angular/router';
10
10
  import { RxStrategyNames } from '@rx-angular/cdk/render-strategies';
11
11
  import * as i0 from "@angular/core";
12
- export declare const APP_MENU_ITEMS: InjectionToken<IMenuItem[]>;
13
- export declare const APP_MENU_OPTIONS: InjectionToken<MenuOptions>;
14
12
  export declare class MenuComponent implements OnInit {
15
13
  protected platformService: PlatformService;
16
14
  protected accountService: AccountService;
@@ -24,8 +22,6 @@ export declare class MenuComponent implements OnInit {
24
22
  protected router: Router;
25
23
  protected environment: any;
26
24
  protected route: ActivatedRoute;
27
- protected options: MenuOptions;
28
- protected items: IMenuItem[];
29
25
  id: string;
30
26
  menuId: string;
31
27
  side: string;
@@ -42,8 +38,7 @@ export declare class MenuComponent implements OnInit {
42
38
  accountEmail: string;
43
39
  private readonly _debug;
44
40
  private _subscription;
45
- constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, cd: ChangeDetectorRef, menuService: MenuService, router: Router, environment: any, route: ActivatedRoute, // Modal editor give 'null'
46
- options: MenuOptions, items: IMenuItem[]);
41
+ constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, cd: ChangeDetectorRef, menuService: MenuService, router: Router, environment: any, route: ActivatedRoute);
47
42
  ngOnInit(): Promise<void>;
48
43
  onLogin(account: Account): Promise<void>;
49
44
  onLogout(skipRedirect?: boolean): Promise<void>;
@@ -66,6 +61,6 @@ export declare class MenuComponent implements OnInit {
66
61
  protected detectChanges(): void;
67
62
  protected markForCheck(): void;
68
63
  protected togglePinned(event: Event, item: IMenuItem): void;
69
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
70
65
  static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "app-menu", never, { "id": "id"; "menuId": "menuId"; "side": "side"; "contentId": "contentId"; "logo": "logo"; "appName": "appName"; "appVersion": "appVersion"; "rxStrategy": "rxStrategy"; }, {}, never, ["*", "[headerBottomRight]"], false>;
71
66
  }
@@ -68,6 +68,7 @@ export declare class MenuItem implements IMenuItem {
68
68
  get title(): string;
69
69
  set title(value: string);
70
70
  get detached(): boolean;
71
+ get ancestor(): any;
71
72
  isPinned(): any;
72
73
  }
73
74
  export declare class MenuItems {
@@ -118,4 +119,5 @@ export declare class MenuItems {
118
119
  }
119
120
  export declare class MenuOptions {
120
121
  enableSubMenus?: boolean;
122
+ enableSubMenuIcon?: boolean;
121
123
  }
@@ -1,5 +1,6 @@
1
+ import { InjectionToken } from '@angular/core';
1
2
  import { BehaviorSubject, Observable } from 'rxjs';
2
- import { IMenuItem, MenuItem } from './menu.model';
3
+ import { IMenuItem, MenuItem, MenuOptions } from './menu.model';
3
4
  import { Router } from '@angular/router';
4
5
  import { Environment } from '../../../environments/environment.class';
5
6
  import { PlatformService } from '../services/platform.service';
@@ -10,6 +11,8 @@ import { StartableObservableService } from '../../shared/services/startable-obse
10
11
  import * as i0 from "@angular/core";
11
12
  export declare type SplitPaneShowWhen = boolean | 'lg';
12
13
  export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
14
+ export declare const APP_MENU_ITEMS: InjectionToken<IMenuItem[]>;
15
+ export declare const APP_MENU_OPTIONS: InjectionToken<MenuOptions>;
13
16
  export interface MenuPathParam {
14
17
  path: string;
15
18
  params: {
@@ -22,6 +25,7 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
22
25
  protected accountService: AccountService;
23
26
  protected router: Router;
24
27
  protected environment: Environment;
28
+ protected options: MenuOptions;
25
29
  readonly accountChanges: BehaviorSubject<Account>;
26
30
  private _staticItems;
27
31
  private _detachedSubItems;
@@ -30,14 +34,19 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
30
34
  private readonly _$opened;
31
35
  private readonly _$splitPaneWhen;
32
36
  private readonly _$enabled;
37
+ private readonly _$subMenuEnabled;
33
38
  private readonly _$listenRoute;
34
- constructor(platformService: PlatformService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, staticItems?: IMenuItem[]);
39
+ constructor(platformService: PlatformService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, options: MenuOptions, staticItems?: IMenuItem[]);
35
40
  get opened(): Observable<boolean>;
36
41
  get splitPaneWhen(): Observable<SplitPaneShowWhen>;
37
42
  get enabled(): Observable<boolean>;
43
+ get subMenuEnabled(): boolean;
44
+ get subMenuIconEnabled(): boolean;
38
45
  enable(value: boolean): void;
46
+ enableSubMenu(value: boolean): void;
39
47
  setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
40
48
  toggleSplitPaneWhen(): void;
49
+ fromObject(source: any): MenuItem;
41
50
  loadOrCreate(source: Partial<IMenuItem>): MenuItem;
42
51
  addSubMenuItems(sources: IMenuItem[], opts?: {
43
52
  skipIfExists?: boolean;
@@ -45,6 +54,7 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
45
54
  addSubMenuItem(item: IMenuItem, opts?: {
46
55
  skipIfExists?: boolean;
47
56
  }): Promise<MenuItem>;
57
+ removeSubMenuItems(items: IMenuItem[]): Promise<MenuItem[]>;
48
58
  removeSubMenuItem(item: IMenuItem): Promise<MenuItem>;
49
59
  togglePinned(source: IMenuItem): void;
50
60
  _markAsOpened(): void;
@@ -54,11 +64,12 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
54
64
  private _addSubMenuItems;
55
65
  private _addSubMenuItem;
56
66
  private _computeNewId;
67
+ private _removeSubMenuItem;
57
68
  private _detachSubMenuItems;
58
69
  private _detachToParent;
59
70
  private _findExistingItem;
60
71
  private _findParent;
61
72
  private _attachMenuToParent;
62
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, { optional: true; }]>;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
63
74
  static ɵprov: i0.ɵɵInjectableDeclaration<MenuService>;
64
75
  }
@@ -1,5 +1,5 @@
1
- import { BehaviorSubject, Subject, Subscription } from 'rxjs';
2
- import { IStartableService } from './startable-service.class';
1
+ import { BehaviorSubject, Subject, Subscription } from "rxjs";
2
+ import { IStartableService } from "./startable-service.class";
3
3
  /**
4
4
  * Same as StartableService, but with a dataSubject instead of a simple 'data' property
5
5
  */