@wavemaker/angular-codegen 10.11.0-next.24129 → 11.0.0-next.139409

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "private": true,
20
20
  "dependencies": {
21
- "@angular/animations": "11.2.14",
22
- "@angular/common": "11.2.14",
23
- "@angular/compiler": "11.2.14",
24
- "@angular/core": "11.2.14",
25
- "@angular/forms": "11.2.14",
26
- "@angular/platform-browser": "11.2.14",
27
- "@angular/platform-browser-dynamic": "11.2.14",
28
- "@angular/router": "11.2.14",
29
- "@angular/service-worker": "11.2.14",
21
+ "@angular/animations": "10.2.5",
22
+ "@angular/common": "10.2.5",
23
+ "@angular/compiler": "10.2.5",
24
+ "@angular/core": "10.2.5",
25
+ "@angular/forms": "10.2.5",
26
+ "@angular/platform-browser": "10.2.5",
27
+ "@angular/platform-browser-dynamic": "10.2.5",
28
+ "@angular/router": "10.2.5",
29
+ "@angular/service-worker": "10.2.5",
30
30
  "@babel/runtime": "^7.14.8",
31
31
  "@ionic-native/app-version": "4.10.0",
32
32
  "@ionic-native/barcode-scanner": "4.10.0",
@@ -68,15 +68,16 @@
68
68
  "tslib": "^2.0.0",
69
69
  "x2js": "3.2.6",
70
70
  "zone.js": "~0.10.3",
71
- "@wavemaker/app-ng-runtime": "10.11.0-next.24129"
71
+ "@wavemaker/app-ng-runtime": "11.0.0-next.139409"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@ampproject/rollup-plugin-closure-compiler": "0.8.5",
75
- "@angular-builders/custom-webpack": "11.1.1",
76
- "@angular-devkit/build-angular": "0.1102.15",
77
- "@angular/cli": "11.2.15",
78
- "@angular/compiler-cli": "11.2.14",
79
- "@angular/language-service": "11.2.14",
75
+ "@angular-builders/custom-webpack": "9.2.0",
76
+ "@angular-devkit/build-angular": "0.1002.3",
77
+ "@angular-devkit/build-ng-packagr": "0.1002.3",
78
+ "@angular/cli": "10.2.3",
79
+ "@angular/compiler-cli": "10.2.5",
80
+ "@angular/language-service": "10.2.5",
80
81
  "@babel/plugin-transform-runtime": "^7.14.5",
81
82
  "@compodoc/compodoc": "1.1.11",
82
83
  "@types/jasmine": "2.8.8",
@@ -102,7 +103,7 @@
102
103
  "karma-jasmine-html-reporter": "^1.5.0",
103
104
  "karma-mocha-reporter": "2.2.5",
104
105
  "moment": "2.24.0",
105
- "ng-packagr": "11.2.4",
106
+ "ng-packagr": "^10.1.2",
106
107
  "npm-run-all": "4.1.5",
107
108
  "rimraf": "2.6.3",
108
109
  "rollup": "0.65.2",
@@ -113,7 +114,7 @@
113
114
  "rollup-plugin-node-resolve": "3.4.0",
114
115
  "ts-node": "7.0.1",
115
116
  "tslint": "~6.1.0",
116
- "typescript": "4.1.6",
117
+ "typescript": "3.9.10",
117
118
  "util": "0.11.1"
118
119
  }
119
120
  }
@@ -1,44 +1,55 @@
1
1
  import {
2
2
  Injectable,
3
+ NgModuleFactoryLoader,
3
4
  NgModuleRef,
4
5
  Type,
5
6
  Injector,
7
+ SystemJsNgModuleLoader,
8
+ Inject,
9
+ NgModuleFactory
6
10
  } from '@angular/core';
7
11
  import { PartialRefProvider } from '@wm/core';
8
12
  import { ComponentType } from '@wm/runtime/base';
9
- import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
13
+
10
14
 
11
15
  type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
12
- type Options = {
13
- prefab: string
14
- };
15
16
 
16
17
  @Injectable({
17
18
  providedIn: 'root'
18
19
  })
19
20
  export class LazyComponentRefProviderService extends PartialRefProvider {
20
21
  private moduleRef: NgModuleRef<any>;
21
-
22
- constructor(private injector: Injector) {
22
+ constructor(
23
+ @Inject(NgModuleFactoryLoader) private loader: SystemJsNgModuleLoader,
24
+ private injector: Injector
25
+ ) {
23
26
  super();
24
27
  }
25
-
26
- private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
27
- if (componentType === ComponentType.PARTIAL && options && options.prefab) {
28
- return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
29
- }
30
- if (componentType === ComponentType.PARTIAL) {
31
- return partialLazyModules[componentName];
32
- }
33
- if (componentType === ComponentType.PREFAB) {
34
- return prefabLazyModules[componentName];
28
+ private getModulePath(componentName: string, componentType: ComponentType, options?: any): string {
29
+ if (componentName.length > 0) {
30
+ if (componentType === ComponentType.PARTIAL && options && options.prefab) {
31
+ return `src/app/prefabs/${options.prefab}/partials/${componentName}/${componentName}.module#${componentName
32
+ .charAt(0)
33
+ .toUpperCase()}${componentName.slice(1)}Module`;
34
+ }
35
+ if (componentType === ComponentType.PARTIAL) {
36
+ return `src/app/partials/${componentName}/${componentName}.module#${componentName
37
+ .charAt(0)
38
+ .toUpperCase()}${componentName.slice(1)}Module`;
39
+ } else if (componentType === ComponentType.PREFAB) {
40
+ return `src/app/prefabs/${componentName}/${componentName}.module#${componentName
41
+ .charAt(0)
42
+ .toUpperCase()}${componentName.slice(1)}Module`;
43
+ }
35
44
  }
45
+ return null;
36
46
  }
37
-
38
- public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
47
+ public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: {}) {
48
+ let moduleFactory: NgModuleFactory<any>;
39
49
  try {
40
- const moduleFactory = await this.getLazyModule(componentName, componentType, options).loadChildren();
41
-
50
+ moduleFactory = await this.loader.load(
51
+ this.getModulePath(componentName, componentType, options)
52
+ );
42
53
  this.moduleRef = moduleFactory.create(this.injector);
43
54
  const rootComponent = (moduleFactory.moduleType as ModuleWithRoot)
44
55
  .rootComponent;
@@ -15,7 +15,7 @@ if (environment.production) {
15
15
  }
16
16
 
17
17
  document.addEventListener('DOMContentLoaded', () => {
18
- new Promise<Event | void>( resolve => {
18
+ new Promise( resolve => {
19
19
  if (isSpotcues) {
20
20
  initSpotCues().then(resolve);
21
21
  } else if (window['cordova']) {