@wavemaker-ai/app-ng-runtime 1.0.0-rc.309 → 1.0.0-rc.314

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,12 +1,12 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/app-ng-runtime",
3
- "version": "1.0.0-rc.309",
3
+ "version": "1.0.0-rc.314",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@wavemaker-ai/app-ng-runtime",
9
- "version": "1.0.0-rc.309",
9
+ "version": "1.0.0-rc.314",
10
10
  "license": "MIT",
11
11
  "engines": {
12
12
  "node": ">=18.16.1",
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/app-ng-runtime",
3
- "version": "1.0.0-rc.309",
3
+ "version": "1.0.0-rc.314",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@wavemaker-ai/app-ng-runtime",
9
- "version": "1.0.0-rc.309",
9
+ "version": "1.0.0-rc.314",
10
10
  "license": "MIT",
11
11
  "engines": {
12
12
  "node": ">=18.16.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/app-ng-runtime",
3
- "version": "1.0.0-rc.309",
3
+ "version": "1.0.0-rc.314",
4
4
  "description": "All modules required for a WaveMaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4565,6 +4565,11 @@
4565
4565
  }], ctorParameters: () => [{ type: i1__namespace.AbstractI18nService }] });
4566
4566
 
4567
4567
  class AppComponent {
4568
+ set routerOutlet(outlet) {
4569
+ if (outlet) {
4570
+ this.overrideRouterOutlet(outlet);
4571
+ }
4572
+ }
4568
4573
  constructor(_pipeProvider, _appRef, elRef, oAuthService, dialogService, spinnerService, ngZone, router, app, appManager, customIconsLoaderService) {
4569
4574
  this.elRef = elRef;
4570
4575
  this.oAuthService = oAuthService;
@@ -4676,20 +4681,26 @@
4676
4681
  });
4677
4682
  setTimeout(() => {
4678
4683
  this.app.dynamicComponentContainerRef = this.dynamicComponentContainerRef;
4679
- this.overrideRouterOutlet();
4680
4684
  }, 10);
4681
4685
  }
4682
- overrideRouterOutlet() {
4683
- //override the attach/detach methods
4684
- const oAttach = this.routerOutlet.attach;
4685
- const oDetach = this.routerOutlet.detach;
4686
- this.routerOutlet.attach = (componentRef, activatedRoute) => {
4687
- oAttach.call(this.routerOutlet, componentRef, activatedRoute);
4688
- componentRef.instance.ngOnAttach();
4686
+ overrideRouterOutlet(outlet) {
4687
+ if (outlet.__isPatched) {
4688
+ return;
4689
+ }
4690
+ outlet.__isPatched = true;
4691
+ const oAttach = outlet.attach;
4692
+ const oDetach = outlet.detach;
4693
+ outlet.attach = (componentRef, activatedRoute) => {
4694
+ oAttach.call(outlet, componentRef, activatedRoute);
4695
+ if (componentRef?.instance?.ngOnAttach) {
4696
+ componentRef.instance.ngOnAttach();
4697
+ }
4689
4698
  };
4690
- this.routerOutlet.detach = () => {
4691
- this.app.activePage.ngOnDetach();
4692
- const componentRef = oDetach.call(this.routerOutlet);
4699
+ outlet.detach = () => {
4700
+ if (this.app?.activePage?.ngOnDetach) {
4701
+ this.app.activePage.ngOnDetach();
4702
+ }
4703
+ const componentRef = oDetach.call(outlet);
4693
4704
  return componentRef;
4694
4705
  };
4695
4706
  }
@@ -4667,6 +4667,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
4667
4667
  }], ctorParameters: () => [{ type: i1.AbstractI18nService }] });
4668
4668
 
4669
4669
  class AppComponent {
4670
+ set routerOutlet(outlet) {
4671
+ if (outlet) {
4672
+ this.overrideRouterOutlet(outlet);
4673
+ }
4674
+ }
4670
4675
  constructor(_pipeProvider, _appRef, elRef, oAuthService, dialogService, spinnerService, ngZone, router, app, appManager, customIconsLoaderService) {
4671
4676
  this.elRef = elRef;
4672
4677
  this.oAuthService = oAuthService;
@@ -4778,20 +4783,26 @@ class AppComponent {
4778
4783
  });
4779
4784
  setTimeout(() => {
4780
4785
  this.app.dynamicComponentContainerRef = this.dynamicComponentContainerRef;
4781
- this.overrideRouterOutlet();
4782
4786
  }, 10);
4783
4787
  }
4784
- overrideRouterOutlet() {
4785
- //override the attach/detach methods
4786
- const oAttach = this.routerOutlet.attach;
4787
- const oDetach = this.routerOutlet.detach;
4788
- this.routerOutlet.attach = (componentRef, activatedRoute) => {
4789
- oAttach.call(this.routerOutlet, componentRef, activatedRoute);
4790
- componentRef.instance.ngOnAttach();
4788
+ overrideRouterOutlet(outlet) {
4789
+ if (outlet.__isPatched) {
4790
+ return;
4791
+ }
4792
+ outlet.__isPatched = true;
4793
+ const oAttach = outlet.attach;
4794
+ const oDetach = outlet.detach;
4795
+ outlet.attach = (componentRef, activatedRoute) => {
4796
+ oAttach.call(outlet, componentRef, activatedRoute);
4797
+ if (componentRef?.instance?.ngOnAttach) {
4798
+ componentRef.instance.ngOnAttach();
4799
+ }
4791
4800
  };
4792
- this.routerOutlet.detach = () => {
4793
- this.app.activePage.ngOnDetach();
4794
- const componentRef = oDetach.call(this.routerOutlet);
4801
+ outlet.detach = () => {
4802
+ if (this.app?.activePage?.ngOnDetach) {
4803
+ this.app.activePage.ngOnDetach();
4804
+ }
4805
+ const componentRef = oDetach.call(outlet);
4795
4806
  return componentRef;
4796
4807
  };
4797
4808
  }