@sumaris-net/ngx-components 2.4.136 → 2.4.137
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/fesm2015/sumaris-net.ngx-components.mjs +8 -9
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +8 -9
- 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
|
@@ -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(
|
|
23086
|
-
super(
|
|
23087
|
-
this.configService = configService;
|
|
23085
|
+
constructor(settings, configService, accountService, router, environment, options, staticItems) {
|
|
23086
|
+
super();
|
|
23088
23087
|
this.settings = settings;
|
|
23088
|
+
this.configService = configService;
|
|
23089
23089
|
this.accountService = accountService;
|
|
23090
23090
|
this.router = router;
|
|
23091
23091
|
this.environment = environment;
|
|
@@ -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: [{
|