@sumaris-net/ngx-components 2.4.133 → 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.133",
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,17 +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
- import { ConfigService } from '../services/config.service';
7
6
  import { PlatformService } from '../services/platform.service';
8
7
  import { MenuService, SplitPaneShowWhen } from './menu.service';
9
- import { IMenuItem, MenuOptions } from './menu.model';
8
+ import { IMenuItem } from './menu.model';
10
9
  import { ActivatedRoute, Router } from '@angular/router';
11
10
  import { RxStrategyNames } from '@rx-angular/cdk/render-strategies';
12
11
  import * as i0 from "@angular/core";
13
- export declare const APP_MENU_ITEMS: InjectionToken<IMenuItem[]>;
14
- export declare const APP_MENU_OPTIONS: InjectionToken<MenuOptions>;
15
12
  export declare class MenuComponent implements OnInit {
16
13
  protected platformService: PlatformService;
17
14
  protected accountService: AccountService;
@@ -20,14 +17,11 @@ export declare class MenuComponent implements OnInit {
20
17
  protected modalCtrl: ModalController;
21
18
  protected alertController: AlertController;
22
19
  protected translate: TranslateService;
23
- protected configService: ConfigService;
24
20
  protected cd: ChangeDetectorRef;
25
21
  protected menuService: MenuService;
26
22
  protected router: Router;
27
23
  protected environment: any;
28
24
  protected route: ActivatedRoute;
29
- protected options: MenuOptions;
30
- protected items: IMenuItem[];
31
25
  id: string;
32
26
  menuId: string;
33
27
  side: string;
@@ -44,8 +38,7 @@ export declare class MenuComponent implements OnInit {
44
38
  accountEmail: string;
45
39
  private readonly _debug;
46
40
  private _subscription;
47
- constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, configService: ConfigService, cd: ChangeDetectorRef, menuService: MenuService, router: Router, environment: any, route: ActivatedRoute, // Modal editor give 'null'
48
- 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);
49
42
  ngOnInit(): Promise<void>;
50
43
  onLogin(account: Account): Promise<void>;
51
44
  onLogout(skipRedirect?: boolean): Promise<void>;
@@ -68,6 +61,6 @@ export declare class MenuComponent implements OnInit {
68
61
  protected detectChanges(): void;
69
62
  protected markForCheck(): void;
70
63
  protected togglePinned(event: Event, item: IMenuItem): void;
71
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, 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; }]>;
72
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>;
73
66
  }
@@ -1,6 +1,6 @@
1
1
  import { UserProfileLabel } from '../services/model/person.model';
2
2
  import { Configuration } from '../services/model/config.model';
3
- import { IconRef } from '../../shared/types';
3
+ import { AppColors, IconRef } from '../../shared/types';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
  import { MenuPathParam } from './menu.service';
6
6
  import { Account } from '../services/model/account.model';
@@ -12,7 +12,7 @@ export interface IMenuItem extends IconRef {
12
12
  action?: string | any;
13
13
  profile?: UserProfileLabel;
14
14
  exactProfile?: UserProfileLabel;
15
- color?: string;
15
+ color?: string | AppColors;
16
16
  cssClass?: string;
17
17
  ifProperty?: string;
18
18
  titleProperty?: string;
@@ -28,11 +28,14 @@ export interface IMenuItem extends IconRef {
28
28
  };
29
29
  pinned?: boolean;
30
30
  id?: number;
31
+ parent?: IMenuItem;
31
32
  children?: IMenuItem[];
32
33
  }
33
34
  export declare class MenuItem implements IMenuItem {
34
35
  id?: number;
35
- _title: string;
36
+ parent?: MenuItem;
37
+ $children: BehaviorSubject<MenuItem[]>;
38
+ $title: BehaviorSubject<string>;
36
39
  titleProperty?: string;
37
40
  titleArgs?: {
38
41
  [key: string]: string;
@@ -50,13 +53,13 @@ export declare class MenuItem implements IMenuItem {
50
53
  action?: string | any;
51
54
  profile?: UserProfileLabel;
52
55
  exactProfile?: UserProfileLabel;
53
- color?: string;
56
+ color?: string | AppColors;
54
57
  cssClass?: string;
55
58
  ifProperty?: string;
56
59
  pinned?: boolean;
57
- parent?: MenuItem;
58
- $title: BehaviorSubject<string>;
59
- $children: BehaviorSubject<MenuItem[]>;
60
+ icon?: string;
61
+ matIcon?: string;
62
+ matSvgIcon?: string;
60
63
  static fromObject(source: any): MenuItem;
61
64
  fromObject(source: any): void;
62
65
  asObject(): any;
@@ -65,6 +68,7 @@ export declare class MenuItem implements IMenuItem {
65
68
  get title(): string;
66
69
  set title(value: string);
67
70
  get detached(): boolean;
71
+ get ancestor(): any;
68
72
  isPinned(): any;
69
73
  }
70
74
  export declare class MenuItems {
@@ -110,6 +114,10 @@ export declare class MenuItems {
110
114
  static parsePathWithQuery(pathWithQuery: string): MenuPathParam;
111
115
  static getUrl(item: IMenuItem): string;
112
116
  static getUrlFromPathAndParams(path: string, params?: any): string;
117
+ static sortByParamOrIdComparator(paramName?: string): (n1: IMenuItem, n2: IMenuItem) => number;
118
+ static sortByTabOrId: (n1: IMenuItem, n2: IMenuItem) => number;
113
119
  }
114
120
  export declare class MenuOptions {
121
+ enableSubMenus?: boolean;
122
+ enableSubMenuIcon?: boolean;
115
123
  }
@@ -1,19 +1,18 @@
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';
6
7
  import { AccountService } from '../services/account.service';
7
8
  import { ConfigService } from '../services/config.service';
8
- import { Configuration } from '../services/model/config.model';
9
9
  import { Account } from '../services/model/account.model';
10
10
  import { StartableObservableService } from '../../shared/services/startable-observable-service.class';
11
11
  import * as i0 from "@angular/core";
12
12
  export declare type SplitPaneShowWhen = boolean | 'lg';
13
13
  export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
14
- export interface AddSubMenuItemsOption {
15
- skipIfExists?: boolean;
16
- }
14
+ export declare const APP_MENU_ITEMS: InjectionToken<IMenuItem[]>;
15
+ export declare const APP_MENU_OPTIONS: InjectionToken<MenuOptions>;
17
16
  export interface MenuPathParam {
18
17
  path: string;
19
18
  params: {
@@ -26,6 +25,7 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
26
25
  protected accountService: AccountService;
27
26
  protected router: Router;
28
27
  protected environment: Environment;
28
+ protected options: MenuOptions;
29
29
  readonly accountChanges: BehaviorSubject<Account>;
30
30
  private _staticItems;
31
31
  private _detachedSubItems;
@@ -34,37 +34,42 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
34
34
  private readonly _$opened;
35
35
  private readonly _$splitPaneWhen;
36
36
  private readonly _$enabled;
37
+ private readonly _$subMenuEnabled;
37
38
  private readonly _$listenRoute;
38
- 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[]);
39
40
  get opened(): Observable<boolean>;
40
41
  get splitPaneWhen(): Observable<SplitPaneShowWhen>;
41
42
  get enabled(): Observable<boolean>;
43
+ get subMenuEnabled(): boolean;
44
+ get subMenuIconEnabled(): boolean;
42
45
  enable(value: boolean): void;
46
+ enableSubMenu(value: boolean): void;
43
47
  setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
44
48
  toggleSplitPaneWhen(): void;
49
+ fromObject(source: any): MenuItem;
45
50
  loadOrCreate(source: Partial<IMenuItem>): MenuItem;
46
- computeId(item: MenuItem): number;
47
- computeNewId(): number;
48
- _markAsOpened(): void;
49
- _markAsClosed(): void;
50
51
  addSubMenuItems(sources: IMenuItem[], opts?: {
51
52
  skipIfExists?: boolean;
52
53
  }): Promise<MenuItem[]>;
53
54
  addSubMenuItem(item: IMenuItem, opts?: {
54
55
  skipIfExists?: boolean;
55
56
  }): Promise<MenuItem>;
56
- removeSubMenuItem(item: IMenuItem): void;
57
- unpinned(source: IMenuItem): void;
58
- private _detachSubMenuItems;
59
- private _detachToParent;
60
- private _findExistingId;
57
+ removeSubMenuItems(items: IMenuItem[]): Promise<MenuItem[]>;
58
+ removeSubMenuItem(item: IMenuItem): Promise<MenuItem>;
59
+ togglePinned(source: IMenuItem): void;
60
+ _markAsOpened(): void;
61
+ _markAsClosed(): void;
61
62
  protected ngOnStart(): Promise<MenuItem[]>;
63
+ private _loadMenuItems;
62
64
  private _addSubMenuItems;
63
65
  private _addSubMenuItem;
64
- protected _loadMenuItems(config: Configuration | null, account: Account | null): MenuItem[];
66
+ private _computeNewId;
67
+ private _removeSubMenuItem;
68
+ private _detachSubMenuItems;
69
+ private _detachToParent;
65
70
  private _findExistingItem;
66
71
  private _findParent;
67
72
  private _attachMenuToParent;
68
- 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; }]>;
69
74
  static ɵprov: i0.ɵɵInjectableDeclaration<MenuService>;
70
75
  }
@@ -14,6 +14,7 @@ export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnD
14
14
  protected parentPath: string;
15
15
  protected path: string;
16
16
  protected showOtherLinks: boolean;
17
+ protected showThirdTab: boolean;
17
18
  protected $title: Subject<string>;
18
19
  protected $secondTabTitle: Subject<string>;
19
20
  protected set title(value: string);
@@ -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
  */
@@ -1308,7 +1308,8 @@ ion-modal.modal-fullscreen {
1308
1308
  }
1309
1309
 
1310
1310
  .popover-notifications {
1311
- --max-height: calc(90vh - 20px /* footer height */);
1311
+ --popover-top: 0;
1312
+ --max-height: calc(90vh - 40px /* header + footer height */ - var(--popover-top, 0px) - var(--offset-y, 0px));
1312
1313
 
1313
1314
  ion-item {
1314
1315
  --ion-item-background-color-hover: var(--ion-color-light);