@sumaris-net/ngx-components 2.4.117 → 2.4.118
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/esm2020/src/app/core/home/home.mjs +5 -4
- package/esm2020/src/app/core/menu/menu.component.mjs +12 -20
- package/esm2020/src/app/core/menu/menu.model.mjs +5 -4
- package/esm2020/src/app/core/menu/menu.service.mjs +53 -72
- package/esm2020/src/app/core/menu/testing/menu-other.testing.mjs +5 -5
- package/esm2020/src/app/core/menu/testing/menu.testing.mjs +24 -8
- package/esm2020/src/app/core/services/account.service.mjs +5 -17
- package/esm2020/src/app/core/services/model/account.model.mjs +27 -2
- package/esm2020/src/environments/environment.mjs +5 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +206 -198
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +124 -122
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/home/home.d.ts +1 -1
- package/src/app/core/menu/menu.model.d.ts +6 -4
- package/src/app/core/menu/menu.service.d.ts +11 -20
- package/src/app/core/menu/testing/menu-other.testing.d.ts +1 -1
- package/src/app/core/menu/testing/menu.testing.d.ts +5 -3
- package/src/app/core/services/model/account.model.d.ts +7 -1
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ export declare class HomePage implements OnDestroy {
|
|
|
67
67
|
protected onSettingsChanged(settings: LocalSettings): void;
|
|
68
68
|
protected onLogin(account: Account): void;
|
|
69
69
|
protected onLogout(): void;
|
|
70
|
-
protected refreshButtons(): void;
|
|
70
|
+
protected refreshButtons(account?: Account): void;
|
|
71
71
|
protected markForCheck(): void;
|
|
72
72
|
static ɵfac: i0.ɵɵFactoryDeclaration<HomePage, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
|
|
73
73
|
static ɵcmp: i0.ɵɵComponentDeclaration<HomePage, "app-page-home", never, {}, {}, never, never, false>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { UserProfileLabel } from '../services/model/person.model';
|
|
2
2
|
import { Configuration } from '../services/model/config.model';
|
|
3
|
-
import { AccountService } from '../services/account.service';
|
|
4
3
|
import { IconRef } from '../../shared/types';
|
|
5
|
-
import { BehaviorSubject } from
|
|
6
|
-
import { MenuPathParam } from
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { MenuPathParam } from './menu.service';
|
|
6
|
+
import { Account } from '../services/model/account.model';
|
|
7
7
|
export interface MenuItem extends IconRef {
|
|
8
8
|
title: string;
|
|
9
9
|
path?: string;
|
|
10
|
+
after?: string;
|
|
11
|
+
before?: string;
|
|
10
12
|
action?: string | any;
|
|
11
13
|
profile?: UserProfileLabel;
|
|
12
14
|
exactProfile?: UserProfileLabel;
|
|
@@ -44,7 +46,7 @@ export declare class MenuItems {
|
|
|
44
46
|
[key: string]: string;
|
|
45
47
|
}): boolean;
|
|
46
48
|
static isParent(child: MenuItem, parent: MenuItem | MenuPathParam): boolean;
|
|
47
|
-
static checkIfVisible(item: MenuItem,
|
|
49
|
+
static checkIfVisible(item: MenuItem, account: Account, config: Configuration, opts?: {
|
|
48
50
|
isLogin?: boolean;
|
|
49
51
|
debug?: boolean;
|
|
50
52
|
logPrefix?: string;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { BehaviorSubject, Observable
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
import { MenuItem } from './menu.model';
|
|
4
4
|
import { Router } from '@angular/router';
|
|
5
5
|
import { StartableService } from '../../shared/services/startable-service.class';
|
|
6
6
|
import { Environment } from '../../../environments/environment.class';
|
|
7
7
|
import { PlatformService } from '../services/platform.service';
|
|
8
|
-
import { Moment } from 'moment';
|
|
9
8
|
import { AccountService } from '../services/account.service';
|
|
10
9
|
import { ConfigService } from '../services/config.service';
|
|
10
|
+
import { Configuration } from '../services/model/config.model';
|
|
11
11
|
import { Account } from '../services/model/account.model';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
export declare type SplitPaneShowWhen = boolean | 'lg';
|
|
14
14
|
export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
|
|
15
15
|
export interface AddSubMenuItemsOption {
|
|
16
|
-
skipIfExists
|
|
17
|
-
|
|
18
|
-
export interface AddSubMenuItems {
|
|
19
|
-
items: MenuItem[];
|
|
20
|
-
opts?: AddSubMenuItemsOption;
|
|
16
|
+
skipIfExists?: boolean;
|
|
17
|
+
availableParents?: MenuItem[];
|
|
21
18
|
}
|
|
22
19
|
export interface MenuPathParam {
|
|
23
20
|
path: string;
|
|
@@ -25,43 +22,37 @@ export interface MenuPathParam {
|
|
|
25
22
|
[key: string]: string;
|
|
26
23
|
};
|
|
27
24
|
}
|
|
28
|
-
export declare class MenuService extends StartableService<MenuItem[]
|
|
25
|
+
export declare class MenuService extends StartableService<BehaviorSubject<MenuItem[]>, any> {
|
|
29
26
|
protected platformService: PlatformService;
|
|
30
27
|
protected configService: ConfigService;
|
|
31
28
|
protected accountService: AccountService;
|
|
32
29
|
protected router: Router;
|
|
33
30
|
protected environment: Environment;
|
|
34
|
-
onLoginChange: Subject<Account>;
|
|
35
31
|
onUpdateMenu: EventEmitter<any>;
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
get $items(): BehaviorSubject<MenuItem[]>;
|
|
33
|
+
private _staticItems;
|
|
38
34
|
private _logPrefix;
|
|
39
|
-
private _config;
|
|
40
|
-
private readonly _$toggled;
|
|
41
35
|
private readonly _$opened;
|
|
42
36
|
private readonly _$splitPaneWhen;
|
|
43
37
|
private readonly _$enabled;
|
|
44
|
-
|
|
45
|
-
constructor(platformService: PlatformService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, rootItems?: MenuItem[]);
|
|
38
|
+
constructor(platformService: PlatformService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, staticItems?: MenuItem[]);
|
|
46
39
|
get opened(): Observable<boolean>;
|
|
47
40
|
get splitPaneWhen(): Observable<SplitPaneShowWhen>;
|
|
48
41
|
get enabled(): Observable<boolean>;
|
|
49
|
-
toggle(): void;
|
|
50
42
|
enable(value: boolean): void;
|
|
51
43
|
setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
|
|
52
44
|
toggleSplitPaneWhen(): void;
|
|
53
45
|
_markAsOpened(): void;
|
|
54
46
|
_markAsClosed(): void;
|
|
55
47
|
addSubMenuItems(newItems: MenuItem[], opts?: AddSubMenuItemsOption): Promise<void>;
|
|
56
|
-
protected ngOnStart(): Promise<MenuItem[]
|
|
57
|
-
protected
|
|
48
|
+
protected ngOnStart(): Promise<BehaviorSubject<MenuItem[]>>;
|
|
49
|
+
protected loadMenuItems(config: Configuration, account: Account): Promise<void>;
|
|
58
50
|
protected addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): Promise<void>;
|
|
59
51
|
protected prepareItem(item: MenuItem): MenuItem;
|
|
60
52
|
protected findExistingItem(item: MenuItem, items?: MenuItem[]): MenuItem;
|
|
61
|
-
protected findParent(childItem: MenuItem,
|
|
53
|
+
protected findParent(childItem: MenuItem, availableParents?: MenuItem[]): MenuItem;
|
|
62
54
|
protected addMenuToParent(parent: MenuItem, child: MenuItem): void;
|
|
63
55
|
protected detachSubMenus(currentPathParam: MenuPathParam, items?: MenuItem[], excludedItems?: MenuItem[]): MenuItem[];
|
|
64
|
-
protected isVisibleForRoute(item: MenuItem, currentPathParam: MenuPathParam): void;
|
|
65
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, { optional: true; }]>;
|
|
66
57
|
static ɵprov: i0.ɵɵInjectableDeclaration<MenuService>;
|
|
67
58
|
}
|
|
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export declare class OtherMenuTestingPage extends MenuTestingPage {
|
|
8
8
|
constructor(route: ActivatedRoute, // Modal editor give 'null'
|
|
9
9
|
router: Router, navController: NavController, alertCtrl: AlertController, translate: TranslateService, menuService: MenuService);
|
|
10
|
-
initSubMenu(): void
|
|
10
|
+
initSubMenu(): Promise<void>;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<OtherMenuTestingPage, never>;
|
|
12
12
|
static ɵcmp: i0.ɵɵComponentDeclaration<OtherMenuTestingPage, "app-testing-menu-other", never, {}, {}, never, never, false>;
|
|
13
13
|
}
|
|
@@ -4,8 +4,8 @@ import { AppTabEditor } from '../../form/entity/editor.class';
|
|
|
4
4
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
5
5
|
import { AlertController, NavController } from '@ionic/angular';
|
|
6
6
|
import { TranslateService } from '@ngx-translate/core';
|
|
7
|
-
import { MatTab } from
|
|
8
|
-
import { Subject } from
|
|
7
|
+
import { MatTab } from '@angular/material/tabs';
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnDestroy, AfterViewInit {
|
|
11
11
|
protected menuService: MenuService;
|
|
@@ -27,7 +27,9 @@ export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnD
|
|
|
27
27
|
reload(): Promise<void>;
|
|
28
28
|
save(event: Event | undefined, options: any): Promise<boolean>;
|
|
29
29
|
protected toggleThird(): void;
|
|
30
|
-
protected
|
|
30
|
+
protected enableMenu(value: boolean): void;
|
|
31
|
+
protected toggleSplitPaneWhen(): void;
|
|
32
|
+
protected initSubMenu(): Promise<void>;
|
|
31
33
|
protected getFirstInvalidTabIndex(): number;
|
|
32
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuTestingPage, never>;
|
|
33
35
|
static ɵcmp: i0.ɵɵComponentDeclaration<MenuTestingPage, "app-testing-menu", never, {}, {}, never, never, false>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserSettings } from './settings.model';
|
|
2
|
-
import { Person } from './person.model';
|
|
2
|
+
import { Person, UserProfileLabel } from './person.model';
|
|
3
3
|
import { EntityAsObjectOptions } from './entity.model';
|
|
4
4
|
/**
|
|
5
5
|
* A user account
|
|
@@ -16,4 +16,10 @@ export declare class Account extends Person<Account> {
|
|
|
16
16
|
asPerson(): Person;
|
|
17
17
|
get displayName(): string;
|
|
18
18
|
}
|
|
19
|
+
export declare abstract class AccountUtils {
|
|
20
|
+
static accountToString: typeof accountToString;
|
|
21
|
+
static hasMinProfile(account: Account | null, userProfile: UserProfileLabel): boolean;
|
|
22
|
+
static hasExactProfile(account: Account | null, label: UserProfileLabel): boolean;
|
|
23
|
+
static hasProfileAndIsEnable(account: Account | null, userProfile: UserProfileLabel): boolean;
|
|
24
|
+
}
|
|
19
25
|
export declare function accountToString(data: Account): string;
|