@sumaris-net/ngx-components 2.4.142 → 2.4.144
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/admin/users/users.mjs +17 -27
- package/esm2020/src/app/core/menu/menu.component.mjs +7 -55
- package/esm2020/src/app/core/menu/menu.model.mjs +33 -13
- package/esm2020/src/app/core/menu/menu.service.mjs +191 -50
- package/esm2020/src/app/core/services/model/tree-item-entity.model.mjs +6 -4
- package/esm2020/src/environments/environment.mjs +5 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +313 -212
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +301 -201
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/menu/menu.component.d.ts +2 -4
- package/src/app/core/menu/menu.model.d.ts +21 -8
- package/src/app/core/menu/menu.service.d.ts +14 -4
- package/src/app/core/services/model/tree-item-entity.model.d.ts +1 -1
- package/src/assets/i18n/fr.json +1 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ 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 } from './menu.model';
|
|
8
|
+
import { IMenuItem, MenuItem } 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";
|
|
@@ -42,15 +42,13 @@ export declare class MenuComponent implements OnInit {
|
|
|
42
42
|
ngOnInit(): Promise<void>;
|
|
43
43
|
onLogin(account: Account): Promise<void>;
|
|
44
44
|
onLogout(skipRedirect?: boolean): Promise<void>;
|
|
45
|
-
logout(): Promise<void>;
|
|
46
45
|
trackByFn(index: number, item: IMenuItem): string;
|
|
47
46
|
enable(value: boolean): Promise<void>;
|
|
48
47
|
open(): Promise<boolean>;
|
|
49
48
|
close(): Promise<boolean>;
|
|
50
|
-
openAboutModal(event?: Event): Promise<void>;
|
|
51
49
|
setSplitPaneWhen(value: SplitPaneShowWhen): Promise<void>;
|
|
52
50
|
toggleSplitPaneShow(event?: Event): Promise<void>;
|
|
53
|
-
|
|
51
|
+
executeAction(event: Event, item: MenuItem): Promise<void>;
|
|
54
52
|
onSwipeRight(event: any): boolean;
|
|
55
53
|
protected markAsLoaded(opts?: {
|
|
56
54
|
emitEvent?: boolean;
|
|
@@ -7,10 +7,14 @@ import { Account } from '../services/model/account.model';
|
|
|
7
7
|
import { Entity, EntityAsObjectOptions } from '../services/model/entity.model';
|
|
8
8
|
import { ITreeItemEntity } from '../services/model/tree-item-entity.model';
|
|
9
9
|
export interface IMenuItem extends IconRef {
|
|
10
|
+
id?: number;
|
|
11
|
+
parent?: IMenuItem;
|
|
12
|
+
children?: IMenuItem[];
|
|
10
13
|
title: string;
|
|
11
14
|
path?: string;
|
|
12
15
|
after?: string;
|
|
13
16
|
before?: string;
|
|
17
|
+
static?: boolean;
|
|
14
18
|
action?: string | any;
|
|
15
19
|
profile?: UserProfileLabel;
|
|
16
20
|
exactProfile?: UserProfileLabel;
|
|
@@ -29,15 +33,16 @@ export interface IMenuItem extends IconRef {
|
|
|
29
33
|
[key: string]: string;
|
|
30
34
|
};
|
|
31
35
|
pinned?: boolean;
|
|
32
|
-
id?: number;
|
|
33
|
-
parent?: IMenuItem;
|
|
34
|
-
children?: IMenuItem[];
|
|
35
36
|
}
|
|
36
37
|
export declare class MenuItem extends Entity<MenuItem> implements IMenuItem, ITreeItemEntity<MenuItem> {
|
|
38
|
+
static fromObject: (source: any, opts?: {
|
|
39
|
+
withChildren?: boolean;
|
|
40
|
+
}) => MenuItem;
|
|
37
41
|
id: number;
|
|
38
42
|
parent: MenuItem;
|
|
39
43
|
parentId: number;
|
|
40
44
|
$children: BehaviorSubject<MenuItem[]>;
|
|
45
|
+
static: boolean;
|
|
41
46
|
$title: BehaviorSubject<string>;
|
|
42
47
|
titleProperty?: string;
|
|
43
48
|
titleArgs?: {
|
|
@@ -63,9 +68,6 @@ export declare class MenuItem extends Entity<MenuItem> implements IMenuItem, ITr
|
|
|
63
68
|
icon?: string;
|
|
64
69
|
matIcon?: string;
|
|
65
70
|
matSvgIcon?: string;
|
|
66
|
-
static fromObject(source: any, opts?: {
|
|
67
|
-
withChildren?: boolean;
|
|
68
|
-
}): MenuItem;
|
|
69
71
|
fromObject(source: any, opts?: {
|
|
70
72
|
withChildren?: boolean;
|
|
71
73
|
}): void;
|
|
@@ -77,7 +79,11 @@ export declare class MenuItem extends Entity<MenuItem> implements IMenuItem, ITr
|
|
|
77
79
|
get title(): string;
|
|
78
80
|
set title(value: string);
|
|
79
81
|
get detached(): boolean;
|
|
82
|
+
get visible(): boolean;
|
|
83
|
+
get expanded(): boolean;
|
|
80
84
|
get ancestor(): MenuItem;
|
|
85
|
+
get divider(): boolean;
|
|
86
|
+
get pinnable(): boolean;
|
|
81
87
|
isPinned(): any;
|
|
82
88
|
}
|
|
83
89
|
export declare class MenuItems {
|
|
@@ -126,7 +132,14 @@ export declare class MenuItems {
|
|
|
126
132
|
static sortByParamOrIdComparator(paramName?: string): (n1: IMenuItem, n2: IMenuItem) => number;
|
|
127
133
|
static sortByTabOrId: (n1: IMenuItem, n2: IMenuItem) => number;
|
|
128
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Options to configure specific behavior on projects
|
|
137
|
+
*/
|
|
129
138
|
export declare class MenuOptions {
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
subMenu?: {
|
|
140
|
+
enable?: boolean;
|
|
141
|
+
showPinButton?: boolean;
|
|
142
|
+
disableIcon?: boolean;
|
|
143
|
+
savePinned?: boolean;
|
|
144
|
+
};
|
|
132
145
|
}
|
|
@@ -8,6 +8,8 @@ import { ConfigService } from '../services/config.service';
|
|
|
8
8
|
import { Account } from '../services/model/account.model';
|
|
9
9
|
import { StartableObservableService } from '../../shared/services/startable-observable-service.class';
|
|
10
10
|
import { LocalSettingsService } from '../services/local-settings.service';
|
|
11
|
+
import { AlertController, ModalController, NavController } from '@ionic/angular';
|
|
12
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
11
13
|
import * as i0 from "@angular/core";
|
|
12
14
|
export declare type SplitPaneShowWhen = boolean | 'lg';
|
|
13
15
|
export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
|
|
@@ -24,6 +26,10 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
24
26
|
protected configService: ConfigService;
|
|
25
27
|
protected accountService: AccountService;
|
|
26
28
|
protected router: Router;
|
|
29
|
+
protected modalCtrl: ModalController;
|
|
30
|
+
protected alertController: AlertController;
|
|
31
|
+
protected navController: NavController;
|
|
32
|
+
protected translate: TranslateService;
|
|
27
33
|
protected environment: Environment;
|
|
28
34
|
readonly accountChanges: BehaviorSubject<Account>;
|
|
29
35
|
readonly onPinned: EventEmitter<MenuItem>;
|
|
@@ -35,14 +41,13 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
35
41
|
private readonly _$opened;
|
|
36
42
|
private readonly _$splitPaneWhen;
|
|
37
43
|
private readonly _$enabled;
|
|
38
|
-
private readonly _$
|
|
44
|
+
private readonly _$enableSubMenu;
|
|
39
45
|
private readonly _$listenRoute;
|
|
40
|
-
constructor(settings: LocalSettingsService, configService: ConfigService, accountService: AccountService, router: Router, environment: Environment, options?: MenuOptions, staticItems?: IMenuItem[]);
|
|
46
|
+
constructor(settings: LocalSettingsService, configService: ConfigService, accountService: AccountService, router: Router, modalCtrl: ModalController, alertController: AlertController, navController: NavController, translate: TranslateService, environment: Environment, options?: MenuOptions, staticItems?: IMenuItem[]);
|
|
41
47
|
get opened(): Observable<boolean>;
|
|
42
48
|
get splitPaneWhen(): Observable<SplitPaneShowWhen>;
|
|
43
49
|
get enabled(): Observable<boolean>;
|
|
44
50
|
get subMenuEnabled(): boolean;
|
|
45
|
-
get subMenuIconEnabled(): boolean;
|
|
46
51
|
get subItems(): MenuItem[];
|
|
47
52
|
private get _staticSubItems();
|
|
48
53
|
enable(value: boolean): void;
|
|
@@ -53,6 +58,7 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
53
58
|
withChildren?: boolean;
|
|
54
59
|
computeId?: boolean;
|
|
55
60
|
fillParent?: boolean;
|
|
61
|
+
fillDefaultFromParent?: boolean;
|
|
56
62
|
}): MenuItem;
|
|
57
63
|
createSubMenu(source: Partial<IMenuItem>): MenuItem;
|
|
58
64
|
addSubMenuItems(sources: IMenuItem[], opts?: {
|
|
@@ -64,6 +70,10 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
64
70
|
removeSubMenuItems(items: IMenuItem[]): Promise<MenuItem[]>;
|
|
65
71
|
removeSubMenuItem(item: IMenuItem): Promise<MenuItem>;
|
|
66
72
|
togglePinned(source: IMenuItem): void;
|
|
73
|
+
executeAction(event: Event, item: MenuItem): Promise<void>;
|
|
74
|
+
logout(): Promise<void>;
|
|
75
|
+
openAboutModal(): Promise<void>;
|
|
76
|
+
toggleExpandableItem(item: MenuItem): Promise<void>;
|
|
67
77
|
_markAsOpened(): void;
|
|
68
78
|
_markAsClosed(): void;
|
|
69
79
|
protected ngOnStart(): Promise<MenuItem[]>;
|
|
@@ -77,6 +87,6 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
77
87
|
private _findExistingItem;
|
|
78
88
|
private _findParent;
|
|
79
89
|
private _attachMenuToParent;
|
|
80
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
81
91
|
static ɵprov: i0.ɵɵInjectableDeclaration<MenuService>;
|
|
82
92
|
}
|
|
@@ -27,7 +27,7 @@ export declare class TreeItemEntityUtils {
|
|
|
27
27
|
* @param node
|
|
28
28
|
* @param action
|
|
29
29
|
*/
|
|
30
|
-
static visit<T extends ITreeItemEntity<any>>(node: T, action: (
|
|
30
|
+
static visit<T extends ITreeItemEntity<any>>(node: T, action: (item: T) => void): void;
|
|
31
31
|
/**
|
|
32
32
|
* Visit each node, from leaf to root
|
|
33
33
|
*
|