@esfaenza/core 19.2.73 → 19.2.76
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injector } from "@angular/core";
|
|
2
|
-
import {
|
|
2
|
+
import { Data, UrlSegment } from "@angular/router";
|
|
3
3
|
import { ReactiveComponent } from "./reactive.component";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare abstract class BaseComponent extends ReactiveComponent {
|
|
@@ -18,7 +18,7 @@ export declare abstract class BaseComponent extends ReactiveComponent {
|
|
|
18
18
|
private _emb;
|
|
19
19
|
private _location;
|
|
20
20
|
constructor(injector: Injector);
|
|
21
|
-
gatherRouteInformations(
|
|
21
|
+
gatherRouteInformations(segs: UrlSegment[], data: Data): void;
|
|
22
22
|
protected navigate(command: any[], extras?: any): void;
|
|
23
23
|
back(): void;
|
|
24
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseComponent, never>;
|
|
@@ -1053,21 +1053,21 @@ class BaseComponent extends ReactiveComponent {
|
|
|
1053
1053
|
// Parametri in maniera "dinamica"
|
|
1054
1054
|
_activatedRoute.params.pipe(takeUntil$1(this.destroyed$)).subscribe(t => { this.Parameters = t; });
|
|
1055
1055
|
_activatedRoute.queryParams.pipe(takeUntil$1(this.destroyed$)).subscribe(t => { this.QueryParameters = t; });
|
|
1056
|
-
|
|
1056
|
+
combineLatest([_activatedRoute.url, _activatedRoute.data]).subscribe((t) => {
|
|
1057
|
+
this.gatherRouteInformations(t[0], t[1]);
|
|
1058
|
+
});
|
|
1057
1059
|
// Per i componenti navigabili non embeddati è inutile mandare il messaggio di navigazione
|
|
1058
1060
|
// Così come per quelli per cui non esiste un titolo (cioè compoennti verso cui non si è navigato direttamente)
|
|
1059
1061
|
if (!this._emb.Embedded || !this.NavigationTitle)
|
|
1060
1062
|
return;
|
|
1061
1063
|
this._emb.MainWindow.postMessage({ type: "navigation", url: this.CompletePath, internalNavigation: this.InternalNavigation, title: this.NavigationTitle }, "*");
|
|
1062
1064
|
}
|
|
1063
|
-
gatherRouteInformations(
|
|
1064
|
-
// Angular 15 -> 16: non si lavora più coi segmenti. Tiro fuori l'url del router (escludendo parametri e queryparams) e li rigenero
|
|
1065
|
-
let segs = _activatedRoute.snapshot._routerState.url.split('?')[0].split(';')[0].split('/').filter((t, i) => i != 0).map(t => { return { path: t }; });
|
|
1065
|
+
gatherRouteInformations(segs, data) {
|
|
1066
1066
|
this.CompletePath = "/" + segs.map(t => t.path).join('/');
|
|
1067
1067
|
this.ComponentPath = "/" + segs.filter((t, i) => i != 0).map(t => t.path).join('/');
|
|
1068
1068
|
this.BasePath = "/" + segs[0].path;
|
|
1069
|
-
this.InternalNavigation =
|
|
1070
|
-
this.NavigationTitle =
|
|
1069
|
+
this.InternalNavigation = data["internalNavigation"] || false;
|
|
1070
|
+
this.NavigationTitle = data["title"] || "";
|
|
1071
1071
|
}
|
|
1072
1072
|
navigate(command, extras) {
|
|
1073
1073
|
let commands = command;
|
|
@@ -1333,10 +1333,9 @@ class EmbeddingComponent extends BaseComponent {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
ngOnInit() {
|
|
1335
1335
|
let route = this.injector.get(ActivatedRoute);
|
|
1336
|
-
|
|
1337
|
-
this.Module = res[
|
|
1336
|
+
route.params.pipe(debounceTime(100)).subscribe((res) => {
|
|
1337
|
+
this.Module = res["module"];
|
|
1338
1338
|
this.Localhost = this.LocalhostModuleMap[this.Module];
|
|
1339
|
-
this.gatherRouteInformations(route);
|
|
1340
1339
|
console.log(`Recognized a new navigation to the embedding component: ${this.Module} - ${this.CompletePath}`);
|
|
1341
1340
|
let reloadAllowed = this.emb.IsReloadAllowed();
|
|
1342
1341
|
if (this.Page && reloadAllowed) {
|