@sumaris-net/ngx-components 2.4.138 → 2.4.139
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.service.mjs +6 -7
- package/esm2020/src/app/core/menu/sub-menu-tab.directive.mjs +2 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +5 -9
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +6 -10
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/menu/menu.service.d.ts +1 -1
|
@@ -23089,7 +23089,6 @@ class MenuService extends StartableObservableService {
|
|
|
23089
23089
|
this.accountService = accountService;
|
|
23090
23090
|
this.router = router;
|
|
23091
23091
|
this.environment = environment;
|
|
23092
|
-
this.options = options;
|
|
23093
23092
|
this.accountChanges = new BehaviorSubject(undefined);
|
|
23094
23093
|
this.pinnedEvent = new EventEmitter();
|
|
23095
23094
|
this._detachedSubItems = [];
|
|
@@ -23099,12 +23098,12 @@ class MenuService extends StartableObservableService {
|
|
|
23099
23098
|
this._$splitPaneWhen = new BehaviorSubject(DEFAULT_MENU_SHOW_WHEN);
|
|
23100
23099
|
this._$enabled = new BehaviorSubject(true);
|
|
23101
23100
|
this._$listenRoute = new BehaviorSubject(false);
|
|
23102
|
-
this.
|
|
23101
|
+
this._options = {
|
|
23103
23102
|
enableSubMenuIcon: true,
|
|
23104
23103
|
...options,
|
|
23105
|
-
enableSubMenus: !this.settings.mobile
|
|
23104
|
+
enableSubMenus: options?.enableSubMenus !== false && !this.settings.mobile
|
|
23106
23105
|
};
|
|
23107
|
-
this._$subMenuEnabled = new BehaviorSubject(this.
|
|
23106
|
+
this._$subMenuEnabled = new BehaviorSubject(this._options.enableSubMenus);
|
|
23108
23107
|
this._debug = !environment.production;
|
|
23109
23108
|
this._staticItems = (staticItems || []).map(source => this.fromObject(source, { computeId: true, fillParent: true }));
|
|
23110
23109
|
this._detachedSubItems = [];
|
|
@@ -23122,7 +23121,7 @@ class MenuService extends StartableObservableService {
|
|
|
23122
23121
|
return this._$subMenuEnabled.value;
|
|
23123
23122
|
}
|
|
23124
23123
|
get subMenuIconEnabled() {
|
|
23125
|
-
return this.
|
|
23124
|
+
return this._options.enableSubMenuIcon;
|
|
23126
23125
|
}
|
|
23127
23126
|
get subItems() {
|
|
23128
23127
|
return (this.data || []).reduce((res, rootElement) => res.concat(rootElement.children), []);
|
|
@@ -23555,7 +23554,7 @@ MenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version:
|
|
|
23555
23554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MenuService, decorators: [{
|
|
23556
23555
|
type: Injectable,
|
|
23557
23556
|
args: [{
|
|
23558
|
-
providedIn: 'root'
|
|
23557
|
+
providedIn: 'root', deps: [ENVIRONMENT]
|
|
23559
23558
|
}]
|
|
23560
23559
|
}], ctorParameters: function () { return [{ type: LocalSettingsService }, { type: ConfigService }, { type: AccountService }, { type: i1$5.Router }, { type: Environment, decorators: [{
|
|
23561
23560
|
type: Inject,
|
|
@@ -23843,15 +23842,12 @@ class SubMenuTabDirective {
|
|
|
23843
23842
|
this.router = router;
|
|
23844
23843
|
this.subMenuIcon = null; // { icon: 'none' };
|
|
23845
23844
|
this.path = MenuItems.parsePathWithQuery(this.router.routerState.snapshot.url).path;
|
|
23846
|
-
this._enable = menuService.subMenuEnabled;
|
|
23847
23845
|
}
|
|
23848
23846
|
ngAfterViewInit() {
|
|
23849
|
-
if (
|
|
23847
|
+
if (!this.tab.disabled)
|
|
23850
23848
|
this._addToMenu();
|
|
23851
23849
|
}
|
|
23852
23850
|
ngOnChanges(changes) {
|
|
23853
|
-
if (!this._enable)
|
|
23854
|
-
return; // Skip
|
|
23855
23851
|
if (changes.disabled || changes.label || changes.subMenuTitle || changes.parentPath || changes.path) {
|
|
23856
23852
|
if (this.disabled) {
|
|
23857
23853
|
this._removeToMenu();
|