@sumaris-net/ngx-components 2.4.133 → 2.4.134
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/menu/menu.component.mjs +19 -27
- package/esm2020/src/app/core/menu/menu.model.mjs +18 -3
- package/esm2020/src/app/core/menu/menu.service.mjs +156 -158
- package/esm2020/src/app/core/menu/sub-menu-tab.directive.mjs +3 -3
- package/esm2020/src/app/core/menu/testing/menu-other.testing.mjs +5 -3
- package/esm2020/src/app/core/menu/testing/menu.testing.mjs +6 -5
- package/esm2020/src/app/social/message/message.form.mjs +11 -8
- package/fesm2015/sumaris-net.ngx-components.mjs +214 -199
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +206 -196
- 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 +13 -7
- package/src/app/core/menu/menu.service.d.ts +8 -14
- package/src/app/core/menu/testing/menu.testing.d.ts +1 -0
- package/src/theme/_ngx-components.scss +2 -1
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@ import { AlertController, IonSplitPane, MenuController, ModalController, NavCont
|
|
|
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
8
|
import { IMenuItem, MenuOptions } from './menu.model';
|
|
@@ -20,7 +19,6 @@ export declare class MenuComponent implements OnInit {
|
|
|
20
19
|
protected modalCtrl: ModalController;
|
|
21
20
|
protected alertController: AlertController;
|
|
22
21
|
protected translate: TranslateService;
|
|
23
|
-
protected configService: ConfigService;
|
|
24
22
|
protected cd: ChangeDetectorRef;
|
|
25
23
|
protected menuService: MenuService;
|
|
26
24
|
protected router: Router;
|
|
@@ -44,7 +42,7 @@ export declare class MenuComponent implements OnInit {
|
|
|
44
42
|
accountEmail: string;
|
|
45
43
|
private readonly _debug;
|
|
46
44
|
private _subscription;
|
|
47
|
-
constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService,
|
|
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'
|
|
48
46
|
options: MenuOptions, items: IMenuItem[]);
|
|
49
47
|
ngOnInit(): Promise<void>;
|
|
50
48
|
onLogin(account: Account): Promise<void>;
|
|
@@ -68,6 +66,6 @@ export declare class MenuComponent implements OnInit {
|
|
|
68
66
|
protected detectChanges(): void;
|
|
69
67
|
protected markForCheck(): void;
|
|
70
68
|
protected togglePinned(event: Event, item: IMenuItem): void;
|
|
71
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, null, null, null, null, null, null, null, null, null,
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
72
70
|
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
71
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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;
|
|
@@ -110,6 +113,9 @@ export declare class MenuItems {
|
|
|
110
113
|
static parsePathWithQuery(pathWithQuery: string): MenuPathParam;
|
|
111
114
|
static getUrl(item: IMenuItem): string;
|
|
112
115
|
static getUrlFromPathAndParams(path: string, params?: any): string;
|
|
116
|
+
static sortByParamOrIdComparator(paramName?: string): (n1: IMenuItem, n2: IMenuItem) => number;
|
|
117
|
+
static sortByTabOrId: (n1: IMenuItem, n2: IMenuItem) => number;
|
|
113
118
|
}
|
|
114
119
|
export declare class MenuOptions {
|
|
120
|
+
enableSubMenus?: boolean;
|
|
115
121
|
}
|
|
@@ -5,15 +5,11 @@ import { Environment } from '../../../environments/environment.class';
|
|
|
5
5
|
import { PlatformService } from '../services/platform.service';
|
|
6
6
|
import { AccountService } from '../services/account.service';
|
|
7
7
|
import { ConfigService } from '../services/config.service';
|
|
8
|
-
import { Configuration } from '../services/model/config.model';
|
|
9
8
|
import { Account } from '../services/model/account.model';
|
|
10
9
|
import { StartableObservableService } from '../../shared/services/startable-observable-service.class';
|
|
11
10
|
import * as i0 from "@angular/core";
|
|
12
11
|
export declare type SplitPaneShowWhen = boolean | 'lg';
|
|
13
12
|
export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
|
|
14
|
-
export interface AddSubMenuItemsOption {
|
|
15
|
-
skipIfExists?: boolean;
|
|
16
|
-
}
|
|
17
13
|
export interface MenuPathParam {
|
|
18
14
|
path: string;
|
|
19
15
|
params: {
|
|
@@ -43,25 +39,23 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
43
39
|
setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
|
|
44
40
|
toggleSplitPaneWhen(): void;
|
|
45
41
|
loadOrCreate(source: Partial<IMenuItem>): MenuItem;
|
|
46
|
-
computeId(item: MenuItem): number;
|
|
47
|
-
computeNewId(): number;
|
|
48
|
-
_markAsOpened(): void;
|
|
49
|
-
_markAsClosed(): void;
|
|
50
42
|
addSubMenuItems(sources: IMenuItem[], opts?: {
|
|
51
43
|
skipIfExists?: boolean;
|
|
52
44
|
}): Promise<MenuItem[]>;
|
|
53
45
|
addSubMenuItem(item: IMenuItem, opts?: {
|
|
54
46
|
skipIfExists?: boolean;
|
|
55
47
|
}): Promise<MenuItem>;
|
|
56
|
-
removeSubMenuItem(item: IMenuItem):
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
private _findExistingId;
|
|
48
|
+
removeSubMenuItem(item: IMenuItem): Promise<MenuItem>;
|
|
49
|
+
togglePinned(source: IMenuItem): void;
|
|
50
|
+
_markAsOpened(): void;
|
|
51
|
+
_markAsClosed(): void;
|
|
61
52
|
protected ngOnStart(): Promise<MenuItem[]>;
|
|
53
|
+
private _loadMenuItems;
|
|
62
54
|
private _addSubMenuItems;
|
|
63
55
|
private _addSubMenuItem;
|
|
64
|
-
|
|
56
|
+
private _computeNewId;
|
|
57
|
+
private _detachSubMenuItems;
|
|
58
|
+
private _detachToParent;
|
|
65
59
|
private _findExistingItem;
|
|
66
60
|
private _findParent;
|
|
67
61
|
private _attachMenuToParent;
|
|
@@ -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);
|
|
@@ -1308,7 +1308,8 @@ ion-modal.modal-fullscreen {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
1310
|
.popover-notifications {
|
|
1311
|
-
--
|
|
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);
|