@sumaris-net/ngx-components 2.4.136 → 2.4.138
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 +11 -12
- package/esm2020/src/app/shared/storage/storage.service.mjs +3 -3
- package/fesm2015/sumaris-net.ngx-components.mjs +10 -11
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +10 -11
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/menu/menu.service.d.ts +2 -2
- 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,
|
|
@@ -23082,10 +23082,10 @@ const DEFAULT_MENU_SHOW_WHEN = 'lg';
|
|
|
23082
23082
|
const APP_MENU_ITEMS = new InjectionToken('menuItems');
|
|
23083
23083
|
const APP_MENU_OPTIONS = new InjectionToken('menuOptions');
|
|
23084
23084
|
class MenuService extends StartableObservableService {
|
|
23085
|
-
constructor(
|
|
23085
|
+
constructor(settings, configService, accountService, router, environment, options, staticItems) {
|
|
23086
23086
|
super(settings);
|
|
23087
|
-
this.configService = configService;
|
|
23088
23087
|
this.settings = settings;
|
|
23088
|
+
this.configService = configService;
|
|
23089
23089
|
this.accountService = accountService;
|
|
23090
23090
|
this.router = router;
|
|
23091
23091
|
this.environment = environment;
|
|
@@ -23102,7 +23102,7 @@ class MenuService extends StartableObservableService {
|
|
|
23102
23102
|
this.options = {
|
|
23103
23103
|
enableSubMenuIcon: true,
|
|
23104
23104
|
...options,
|
|
23105
|
-
enableSubMenus: !this.settings.mobile && options.
|
|
23105
|
+
enableSubMenus: !this.settings.mobile && options.enableSubMenus !== false
|
|
23106
23106
|
};
|
|
23107
23107
|
this._$subMenuEnabled = new BehaviorSubject(this.options.enableSubMenus);
|
|
23108
23108
|
this._debug = !environment.production;
|
|
@@ -23237,7 +23237,8 @@ class MenuService extends StartableObservableService {
|
|
|
23237
23237
|
}
|
|
23238
23238
|
async ngOnStart() {
|
|
23239
23239
|
console.info(`${this._logPrefix}Starting...`);
|
|
23240
|
-
// Restore sub
|
|
23240
|
+
// Restore sub items from settings
|
|
23241
|
+
await this.settings.ready();
|
|
23241
23242
|
const settingsSubItems = this.settings.getPageSettings('menu', 'sub-items');
|
|
23242
23243
|
if (isNotEmptyArray(settingsSubItems)) {
|
|
23243
23244
|
console.debug(this._logPrefix + 'Restoring pinned items from settings...', settingsSubItems);
|
|
@@ -23280,15 +23281,13 @@ class MenuService extends StartableObservableService {
|
|
|
23280
23281
|
console.debug(this._logPrefix + 'Saving pinned items to settings...', pinnedItems);
|
|
23281
23282
|
this.settings.savePageSetting('menu', pinnedItems, 'sub-items');
|
|
23282
23283
|
}));
|
|
23283
|
-
// Restore from settings
|
|
23284
|
-
//
|
|
23285
23284
|
return firstNotNilPromise(this.dataSubject);
|
|
23286
23285
|
}
|
|
23287
23286
|
_loadMenuItems(config, account) {
|
|
23288
23287
|
if (this._debug)
|
|
23289
23288
|
console.debug(`${this._logPrefix}Loading menu items...`);
|
|
23290
23289
|
// Save previous children of root items
|
|
23291
|
-
const detachedSubItems = (this.subItems || [])
|
|
23290
|
+
const detachedSubItems = (this.subItems || [])
|
|
23292
23291
|
.reduce((res, rootItem) => {
|
|
23293
23292
|
const children = rootItem.children;
|
|
23294
23293
|
if (isEmptyArray(children))
|
|
@@ -23551,14 +23550,14 @@ class MenuService extends StartableObservableService {
|
|
|
23551
23550
|
}
|
|
23552
23551
|
}
|
|
23553
23552
|
}
|
|
23554
|
-
MenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MenuService, deps: [{ token:
|
|
23553
|
+
MenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MenuService, deps: [{ token: LocalSettingsService }, { token: ConfigService }, { token: AccountService }, { token: i1$5.Router }, { token: ENVIRONMENT }, { token: APP_MENU_OPTIONS, optional: true }, { token: APP_MENU_ITEMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
23555
23554
|
MenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MenuService, providedIn: 'root' });
|
|
23556
23555
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MenuService, decorators: [{
|
|
23557
23556
|
type: Injectable,
|
|
23558
23557
|
args: [{
|
|
23559
23558
|
providedIn: 'root'
|
|
23560
23559
|
}]
|
|
23561
|
-
}], ctorParameters: function () { return [{ type:
|
|
23560
|
+
}], ctorParameters: function () { return [{ type: LocalSettingsService }, { type: ConfigService }, { type: AccountService }, { type: i1$5.Router }, { type: Environment, decorators: [{
|
|
23562
23561
|
type: Inject,
|
|
23563
23562
|
args: [ENVIRONMENT]
|
|
23564
23563
|
}] }, { type: MenuOptions, decorators: [{
|