@sumaris-net/ngx-components 2.4.137 → 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 +7 -8
- package/esm2020/src/app/core/menu/sub-menu-tab.directive.mjs +2 -5
- package/esm2020/src/app/shared/storage/storage.service.mjs +3 -3
- package/fesm2015/sumaris-net.ngx-components.mjs +8 -12
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +9 -13
- 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
- package/src/app/shared/storage/storage.service.d.ts +0 -1
|
@@ -12962,7 +12962,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
12962
12962
|
class StorageService extends StartableService {
|
|
12963
12963
|
constructor(platform, storage, environment) {
|
|
12964
12964
|
super(platform);
|
|
12965
|
-
this.platform = platform;
|
|
12966
12965
|
this.storage = storage;
|
|
12967
12966
|
this.environment = environment;
|
|
12968
12967
|
this._debug = !environment.production;
|
|
@@ -13074,7 +13073,8 @@ StorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", versi
|
|
|
13074
13073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, decorators: [{
|
|
13075
13074
|
type: Injectable,
|
|
13076
13075
|
args: [{
|
|
13077
|
-
providedIn: 'root',
|
|
13076
|
+
providedIn: 'root',
|
|
13077
|
+
deps: [ENVIRONMENT],
|
|
13078
13078
|
}]
|
|
13079
13079
|
}], ctorParameters: function () { return [{ type: i2.Platform }, { type: i3$1.Storage }, { type: Environment, decorators: [{
|
|
13080
13080
|
type: Inject,
|
|
@@ -23083,13 +23083,12 @@ const APP_MENU_ITEMS = new InjectionToken('menuItems');
|
|
|
23083
23083
|
const APP_MENU_OPTIONS = new InjectionToken('menuOptions');
|
|
23084
23084
|
class MenuService extends StartableObservableService {
|
|
23085
23085
|
constructor(settings, configService, accountService, router, environment, options, staticItems) {
|
|
23086
|
-
super();
|
|
23086
|
+
super(settings);
|
|
23087
23087
|
this.settings = settings;
|
|
23088
23088
|
this.configService = configService;
|
|
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();
|