@sumaris-net/ngx-components 2.4.126 → 2.4.128
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/public_api.mjs +3 -2
- package/esm2020/src/app/core/menu/menu.component.mjs +29 -16
- package/esm2020/src/app/core/menu/menu.model.mjs +29 -1
- package/esm2020/src/app/core/menu/menu.module.mjs +12 -3
- package/esm2020/src/app/core/menu/menu.service.mjs +74 -68
- package/esm2020/src/app/core/menu/sub-menu-tab.directive.mjs +74 -0
- package/esm2020/src/app/core/menu/testing/menu-other.testing.mjs +9 -26
- package/esm2020/src/app/core/menu/testing/menu.testing.mjs +14 -56
- package/esm2020/src/app/core/menu/testing/menu.testing.module.mjs +10 -5
- package/esm2020/src/environments/environment.mjs +5 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +242 -173
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +242 -174
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -1
- package/src/app/core/menu/menu.component.d.ts +5 -3
- package/src/app/core/menu/menu.model.d.ts +3 -0
- package/src/app/core/menu/menu.module.d.ts +6 -5
- package/src/app/core/menu/menu.service.d.ts +9 -7
- package/src/app/core/menu/sub-menu-tab.directive.d.ts +24 -0
- package/src/app/core/menu/testing/menu.testing.d.ts +4 -8
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -211,6 +211,7 @@ export * from './src/app/core/menu/menu.component';
|
|
|
211
211
|
export * from './src/app/core/menu/menu.model';
|
|
212
212
|
export * from './src/app/core/menu/menu.module';
|
|
213
213
|
export * from './src/app/core/menu/menu.service';
|
|
214
|
+
export * from './src/app/core/menu/sub-menu-tab.directive';
|
|
214
215
|
export * from './src/app/core/offline/update-offline-mode-card.component';
|
|
215
216
|
export * from './src/app/core/offline/update-offline-mode-card.module';
|
|
216
217
|
export { EntityClass, EntityClasses } from './src/app/core/services/model/entity.decorators';
|
|
@@ -285,4 +286,4 @@ export * from './src/app/social/job/testing/job-progression.testing.service';
|
|
|
285
286
|
export { MatAutocompleteConfigHolder } from './src/app/shared/material/autocomplete/material.autocomplete.config';
|
|
286
287
|
export { MatAutocompleteFieldAddOptions } from './src/app/shared/material/autocomplete/material.autocomplete.config';
|
|
287
288
|
export { MatAutocompleteFieldConfig } from './src/app/shared/material/autocomplete/material.autocomplete.config';
|
|
288
|
-
export { TableValidatorService } from
|
|
289
|
+
export { TableValidatorService } from './src/app/core/table/testing/table-validator.service';
|
|
@@ -7,7 +7,7 @@ import { ConfigService } from '../services/config.service';
|
|
|
7
7
|
import { PlatformService } from '../services/platform.service';
|
|
8
8
|
import { MenuService, SplitPaneShowWhen } from './menu.service';
|
|
9
9
|
import { MenuItem, MenuOptions } from './menu.model';
|
|
10
|
-
import { ActivatedRoute } from '@angular/router';
|
|
10
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
11
11
|
import { RxStrategyNames } from '@rx-angular/cdk/render-strategies';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
export declare const APP_MENU_ITEMS: InjectionToken<MenuItem[]>;
|
|
@@ -23,6 +23,7 @@ export declare class MenuComponent implements OnInit {
|
|
|
23
23
|
protected configService: ConfigService;
|
|
24
24
|
protected cd: ChangeDetectorRef;
|
|
25
25
|
protected menuService: MenuService;
|
|
26
|
+
protected router: Router;
|
|
26
27
|
protected environment: any;
|
|
27
28
|
protected route: ActivatedRoute;
|
|
28
29
|
protected options: MenuOptions;
|
|
@@ -43,7 +44,7 @@ export declare class MenuComponent implements OnInit {
|
|
|
43
44
|
accountEmail: string;
|
|
44
45
|
private readonly _debug;
|
|
45
46
|
private _subscription;
|
|
46
|
-
constructor(platformService: PlatformService, accountService: AccountService, navController: NavController, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, configService: ConfigService, cd: ChangeDetectorRef, menuService: MenuService, environment: any, route: ActivatedRoute, // Modal editor give 'null'
|
|
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'
|
|
47
48
|
options: MenuOptions, items: MenuItem[]);
|
|
48
49
|
ngOnInit(): Promise<void>;
|
|
49
50
|
onLogin(account: Account): Promise<void>;
|
|
@@ -66,6 +67,7 @@ export declare class MenuComponent implements OnInit {
|
|
|
66
67
|
}): void;
|
|
67
68
|
protected detectChanges(): void;
|
|
68
69
|
protected markForCheck(): void;
|
|
69
|
-
|
|
70
|
+
protected togglePinSubMenu(event: Event, item: MenuItem): 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; }]>;
|
|
70
72
|
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
73
|
}
|
|
@@ -27,6 +27,7 @@ export interface MenuItem extends IconRef {
|
|
|
27
27
|
parentPathParams?: {
|
|
28
28
|
[key: string]: string;
|
|
29
29
|
};
|
|
30
|
+
pinned?: boolean;
|
|
30
31
|
$children?: BehaviorSubject<MenuItem[]>;
|
|
31
32
|
}
|
|
32
33
|
export declare class MenuItems {
|
|
@@ -48,12 +49,14 @@ export declare class MenuItems {
|
|
|
48
49
|
}, otherParams: {
|
|
49
50
|
[key: string]: string;
|
|
50
51
|
}): boolean;
|
|
52
|
+
static prepareItem(item: MenuItem): MenuItem;
|
|
51
53
|
static isParent(child: MenuItem, parent: MenuItem | MenuPathParam): boolean;
|
|
52
54
|
static checkIfVisible(item: MenuItem, account: Account, config: Configuration, opts?: {
|
|
53
55
|
isLogin?: boolean;
|
|
54
56
|
debug?: boolean;
|
|
55
57
|
logPrefix?: string;
|
|
56
58
|
}): boolean;
|
|
59
|
+
static isPinned(item: MenuItem): any;
|
|
57
60
|
static parsePathWithQuery(pathWithQuery: string): MenuPathParam;
|
|
58
61
|
static getUrl(item: MenuItem): string;
|
|
59
62
|
static getUrlFromPathAndParams(path: string, params?: any): string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./menu.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@
|
|
6
|
-
import * as i5 from "@
|
|
3
|
+
import * as i2 from "./sub-menu-tab.directive";
|
|
4
|
+
import * as i3 from "../../shared/shared.module";
|
|
5
|
+
import * as i4 from "@angular/router";
|
|
6
|
+
import * as i5 from "@rx-angular/template/for";
|
|
7
|
+
import * as i6 from "@ngx-translate/core";
|
|
7
8
|
export declare class AppMenuModule {
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppMenuModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AppMenuModule, [typeof i1.MenuComponent], [typeof
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AppMenuModule, [typeof i1.MenuComponent, typeof i2.SubMenuTabDirective], [typeof i3.SharedModule, typeof i4.RouterModule, typeof i5.ForModule, typeof i6.TranslateModule], [typeof i6.TranslateModule, typeof i1.MenuComponent, typeof i2.SubMenuTabDirective]>;
|
|
10
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<AppMenuModule>;
|
|
11
12
|
}
|
|
@@ -46,14 +46,16 @@ export declare class MenuService extends StartableObservableService<MenuItem[]>
|
|
|
46
46
|
_markAsClosed(): void;
|
|
47
47
|
addSubMenuItems(newItems: MenuItem[], opts?: AddSubMenuItemsOption): Promise<boolean[]>;
|
|
48
48
|
addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): Promise<boolean>;
|
|
49
|
+
removeSubMenuItem(item: MenuItem): void;
|
|
50
|
+
detachSubMenuItem(pathParam: MenuPathParam): void;
|
|
51
|
+
protected ngOnStart(): Promise<MenuItem[]>;
|
|
49
52
|
protected _addSubMenuItem(newItem: MenuItem, opts?: AddSubMenuItemsOption): boolean;
|
|
50
|
-
protected
|
|
51
|
-
protected
|
|
52
|
-
protected
|
|
53
|
-
protected
|
|
54
|
-
protected
|
|
55
|
-
protected
|
|
56
|
-
protected detachSubMenus(currentPathParam: MenuPathParam, items?: MenuItem[], excludedItems?: MenuItem[]): MenuItem[];
|
|
53
|
+
protected _loadMenuItems(config: Configuration | null, account: Account | null): Promise<void>;
|
|
54
|
+
protected _findExistingItem(item: MenuItem, items?: MenuItem[]): MenuItem;
|
|
55
|
+
protected _findParent(childItem: MenuItem, availableParents?: MenuItem[]): MenuItem;
|
|
56
|
+
protected _addMenuToParent(parent: MenuItem, child: MenuItem): void;
|
|
57
|
+
protected _detachStoreAndRestore(pathParam: MenuPathParam): void;
|
|
58
|
+
protected _detachSubMenus(currentPathParam: MenuPathParam, items?: MenuItem[], excludedItems?: MenuItem[]): MenuItem[];
|
|
57
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuService, [null, null, null, null, null, { optional: true; }]>;
|
|
58
60
|
static ɵprov: i0.ɵɵInjectableDeclaration<MenuService>;
|
|
59
61
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { MatTab, MatTabGroup } from '@angular/material/tabs';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import { MenuService } from './menu.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class SubMenuTabDirective implements OnChanges, AfterViewInit {
|
|
7
|
+
private menuService;
|
|
8
|
+
private tabGroup;
|
|
9
|
+
private tab;
|
|
10
|
+
private router;
|
|
11
|
+
label: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
parentPath: string;
|
|
14
|
+
path: string;
|
|
15
|
+
subMenuTitle: string;
|
|
16
|
+
private _menuItem;
|
|
17
|
+
constructor(menuService: MenuService, tabGroup: MatTabGroup, tab: MatTab, router: Router);
|
|
18
|
+
ngAfterViewInit(): void;
|
|
19
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
20
|
+
private _computeMenuItem;
|
|
21
|
+
private _addItemToMenu;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubMenuTabDirective, never>;
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SubMenuTabDirective, "[appSubMenuTab]", never, { "label": "label"; "disabled": "disabled"; "parentPath": "parentPath"; "path": "path"; "subMenuTitle": "subMenuTitle"; }, {}, never, never, false>;
|
|
24
|
+
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { AfterViewInit, OnDestroy, OnInit
|
|
1
|
+
import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { MenuService } from '../menu.service';
|
|
3
3
|
import { AppTabEditor } from '../../form/entity/editor.class';
|
|
4
4
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
5
|
-
import { AlertController, NavController } from '@ionic/angular';
|
|
5
|
+
import { AlertController, IonToggle, NavController } from '@ionic/angular';
|
|
6
6
|
import { TranslateService } from '@ngx-translate/core';
|
|
7
|
-
import { MatTab } from '@angular/material/tabs';
|
|
8
|
-
import { Subject } from 'rxjs';
|
|
9
7
|
import * as i0 from "@angular/core";
|
|
10
8
|
export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnDestroy, AfterViewInit {
|
|
11
9
|
protected menuService: MenuService;
|
|
12
|
-
|
|
10
|
+
toggleThird: IonToggle;
|
|
13
11
|
protected logPrefix: string;
|
|
14
12
|
protected childPath: string;
|
|
15
13
|
protected title: string;
|
|
16
14
|
protected secondTabTitle: string;
|
|
15
|
+
protected thirdTabTitle: string;
|
|
17
16
|
protected parentPath: string;
|
|
18
|
-
protected thirdTabTitle: any;
|
|
19
|
-
tabs: QueryList<MatTab>;
|
|
20
17
|
constructor(route: ActivatedRoute, // Modal editor give 'null'
|
|
21
18
|
router: Router, navController: NavController, alertCtrl: AlertController, translate: TranslateService, menuService: MenuService);
|
|
22
19
|
ngOnInit(): void;
|
|
@@ -26,7 +23,6 @@ export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnD
|
|
|
26
23
|
get isNewData(): boolean;
|
|
27
24
|
reload(): Promise<void>;
|
|
28
25
|
save(event: Event | undefined, options: any): Promise<boolean>;
|
|
29
|
-
protected toggleThird(): void;
|
|
30
26
|
protected enableMenu(value: boolean): void;
|
|
31
27
|
protected toggleSplitPaneWhen(): void;
|
|
32
28
|
protected initSubMenu(): Promise<void>;
|