@energycap/components 0.33.0 → 0.33.1
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/lib/shared/page/page-base/page-base.component.mjs +24 -2
- package/fesm2015/energycap-components.mjs +23 -1
- package/fesm2015/energycap-components.mjs.map +1 -1
- package/fesm2020/energycap-components.mjs +23 -1
- package/fesm2020/energycap-components.mjs.map +1 -1
- package/lib/shared/page/page-base/page-base.component.d.ts +8 -0
- package/package.json +1 -1
|
@@ -10194,6 +10194,13 @@ class PageBaseComponent {
|
|
|
10194
10194
|
* Used to opt out of hiding the splash screen when the page is loaded
|
|
10195
10195
|
*/
|
|
10196
10196
|
this.skipHideSplashOnComplete = false;
|
|
10197
|
+
/**
|
|
10198
|
+
* When set to true any navigation end events that are strictly query param changes will
|
|
10199
|
+
* not call the onNavigationEnd function. This allows pages to change the view with query
|
|
10200
|
+
* params and not trigger a full refresh.
|
|
10201
|
+
*/
|
|
10202
|
+
this.ignoreQueryParamsOnNavigationChange = false;
|
|
10203
|
+
this.previousUrl = "";
|
|
10197
10204
|
/**
|
|
10198
10205
|
* Used to unsubscribe from observables
|
|
10199
10206
|
*/
|
|
@@ -10472,10 +10479,21 @@ class PageBaseComponent {
|
|
|
10472
10479
|
*/
|
|
10473
10480
|
setUpRouterSubscriptions() {
|
|
10474
10481
|
if (!this.navigationEndSubscription && !this.destroyed.closed) {
|
|
10482
|
+
this.previousUrl = this.router.url;
|
|
10475
10483
|
// React to navigation events
|
|
10476
10484
|
this.navigationEndSubscription = this.router.events.pipe(takeUntil(this.destroyed), filter(e => e instanceof NavigationEnd)).subscribe(e => {
|
|
10477
10485
|
try {
|
|
10478
|
-
|
|
10486
|
+
let currentUrl = e.url;
|
|
10487
|
+
if (this.ignoreQueryParamsOnNavigationChange) {
|
|
10488
|
+
if (this.previousUrl.split('?')[0] !== currentUrl.split('?')[0]) {
|
|
10489
|
+
this.navigationEndHandler(e.url);
|
|
10490
|
+
}
|
|
10491
|
+
}
|
|
10492
|
+
else {
|
|
10493
|
+
if (this.previousUrl !== currentUrl) {
|
|
10494
|
+
this.navigationEndHandler(e.url);
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10479
10497
|
}
|
|
10480
10498
|
catch (error) {
|
|
10481
10499
|
this.onError(error);
|
|
@@ -10483,6 +10501,10 @@ class PageBaseComponent {
|
|
|
10483
10501
|
});
|
|
10484
10502
|
}
|
|
10485
10503
|
}
|
|
10504
|
+
navigationEndHandler(url) {
|
|
10505
|
+
this.previousUrl = url;
|
|
10506
|
+
this.onNavigationEnd();
|
|
10507
|
+
}
|
|
10486
10508
|
}
|
|
10487
10509
|
PageBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageBaseComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
10488
10510
|
PageBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: PageBaseComponent, host: { properties: { "class": "this.classList" } }, ngImport: i0 });
|