@wavemaker-ai/angular-codegen 1.0.0-rc.647469 → 1.0.0-rc.647502

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker-ai/angular-app",
3
- "version": "1.0.0-rc.647469",
3
+ "version": "1.0.0-rc.647502",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "./node_modules/.bin/ng serve",
@@ -21,28 +21,28 @@
21
21
  ".npmrc"
22
22
  ],
23
23
  "dependencies": {
24
- "@angular/animations": "18.2.13",
25
- "@angular/common": "18.2.13",
26
- "@angular/compiler": "18.2.13",
27
- "@angular/core": "18.2.13",
28
- "@angular/forms": "18.2.13",
29
- "@angular/platform-browser": "18.2.13",
30
- "@angular/platform-browser-dynamic": "18.2.13",
31
- "@angular/router": "18.2.13",
32
- "@angular/service-worker": "18.2.13",
24
+ "@angular/animations": "20.3.19",
25
+ "@angular/common": "20.3.19",
26
+ "@angular/compiler": "20.3.19",
27
+ "@angular/core": "20.3.19",
28
+ "@angular/forms": "20.3.19",
29
+ "@angular/platform-browser": "20.3.19",
30
+ "@angular/platform-browser-dynamic": "20.3.19",
31
+ "@angular/router": "20.3.19",
32
+ "@angular/service-worker": "20.3.19",
33
33
  "@fullcalendar/core": "6.1.18",
34
34
  "@fullcalendar/daygrid": "6.1.18",
35
35
  "@fullcalendar/interaction": "6.1.18",
36
36
  "@fullcalendar/list": "6.1.18",
37
37
  "@fullcalendar/timegrid": "6.1.18",
38
38
  "@metrichor/jmespath": "0.3.1",
39
- "@wavemaker-ai/custom-widgets-m3": "1.0.0-rc.647469",
39
+ "@wavemaker-ai/custom-widgets-m3": "1.0.0-rc.647502",
40
40
  "@wavemaker/focus-trap": "1.0.1",
41
- "@wavemaker-ai/foundation-css": "1.0.0-rc.647469",
41
+ "@wavemaker-ai/foundation-css": "1.0.0-rc.647502",
42
42
  "@wavemaker/nvd3": "1.8.16",
43
- "@wavemaker-ai/variables": "1.0.0-rc.647469",
43
+ "@wavemaker-ai/variables": "1.0.0-rc.647502",
44
44
  "@ztree/ztree_v3": "3.5.48",
45
- "acorn": "^8.15.0",
45
+ "acorn": "8.15.0",
46
46
  "angular-imask": "7.6.1",
47
47
  "angular2-websocket": "0.9.8",
48
48
  "d3": "7.8.5",
@@ -50,80 +50,82 @@
50
50
  "jquery": "3.7.1",
51
51
  "jquery-ui": "1.14.1",
52
52
  "jssha": "3.3.1",
53
- "lodash-es": "4.17.21",
53
+ "lodash-es": "4.18.1",
54
54
  "moment": "2.30.1",
55
- "moment-timezone": "^0.6.0",
55
+ "moment-timezone": "0.6.0",
56
56
  "ng-circle-progress": "1.7.1",
57
- "ngx-bootstrap": "9.0.0",
57
+ "ngx-bootstrap": "20.0.2",
58
58
  "ngx-color-picker": "20.1.1",
59
- "ngx-toastr": "19.0.0",
59
+ "ngx-toastr": "19.1.0",
60
60
  "rxjs": "7.8.2",
61
61
  "summernote": "0.9.1",
62
62
  "tslib": "2.8.1",
63
63
  "x2js": "3.4.4",
64
64
  "zone.js": "0.15.1",
65
- "@wavemaker-ai/app-ng-runtime": "1.0.0-rc.647469"
65
+ "@wavemaker-ai/app-ng-runtime": "1.0.0-rc.647502"
66
66
  },
67
67
  "devDependencies": {
68
- "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
69
- "@angular-builders/custom-webpack": "18.0.0",
70
- "@angular-devkit/build-angular": "18.2.20",
68
+ "@ampproject/rollup-plugin-closure-compiler": "0.27.0",
69
+ "@angular-builders/custom-webpack": "20.0.0",
70
+ "@angular-devkit/build-angular": "20.3.19",
71
71
  "@angular-eslint/builder": "20.1.1",
72
72
  "@angular-eslint/eslint-plugin": "20.1.1",
73
73
  "@angular-eslint/eslint-plugin-template": "20.1.1",
74
74
  "@angular-eslint/schematics": "20.1.1",
75
75
  "@angular-eslint/template-parser": "20.1.1",
76
- "@angular/cli": "18.2.12",
77
- "@angular/compiler-cli": "18.2.13",
78
- "@angular/language-service": "18.2.13",
79
- "@compodoc/compodoc": "^1.1.26",
76
+ "@angular/cli": "20.3.19",
77
+ "@angular/compiler-cli": "20.3.19",
78
+ "@angular/language-service": "20.3.19",
79
+ "@compodoc/compodoc": "1.2.1",
80
80
  "@rollup/plugin-alias": "5.1.1",
81
81
  "@rollup/plugin-commonjs": "28.0.6",
82
82
  "@rollup/plugin-multi-entry": "6.0.1",
83
83
  "@rollup/plugin-node-resolve": "16.0.1",
84
- "@rollup/plugin-typescript": "^12.1.4",
85
- "@types/jest": "^30.0.0",
86
- "@types/jquery": "^3.5.32",
84
+ "@rollup/plugin-typescript": "12.3.0",
85
+ "@types/jest": "30.0.0",
86
+ "@types/jquery": "3.5.32",
87
87
  "@types/lodash-es": "4.17.12",
88
- "@types/node": "^24.2.0",
88
+ "@types/node": "24.2.0",
89
89
  "@typescript-eslint/eslint-plugin": "8.39.0",
90
90
  "@typescript-eslint/parser": "8.39.0",
91
91
  "cheerio": "1.1.2",
92
- "compression-webpack-plugin": "11.1.0",
92
+ "compression-webpack-plugin": "12.0.0",
93
93
  "core-js": "3.45.0",
94
- "eslint": "^8.45.0",
94
+ "eslint": "8.45.0",
95
95
  "fs": "0.0.1-security",
96
96
  "fs-extra": "11.3.1",
97
- "jest": "^30.0.5",
98
- "jest-canvas-mock": "^2.5.2",
99
- "jest-environment-jsdom": "^30.0.5",
100
- "jest-preset-angular": "^15.0.0",
97
+ "jest": "30.0.5",
98
+ "jest-canvas-mock": "2.5.2",
99
+ "jest-environment-jsdom": "30.0.5",
100
+ "jest-preset-angular": "15.0.0",
101
101
  "license-checker": "25.0.1",
102
- "moment-locales-webpack-plugin": "^1.2.0",
103
- "ng-packagr": "17.3.0",
104
- "owasp-dependency-check": "0.8.1",
102
+ "moment-locales-webpack-plugin": "1.2.0",
103
+ "ng-packagr": "20.3.2",
104
+ "owasp-dependency-check": "1.0.1",
105
105
  "rimraf": "6.0.1",
106
- "rollup": "4.46.2",
106
+ "rollup": "4.60.1",
107
107
  "sonarqube-scanner": "3.5.0",
108
- "terser": "^5.43.1",
109
- "typescript": "5.5.4",
108
+ "terser": "5.43.1",
109
+ "typescript": "5.9.3",
110
110
  "util": "0.12.5",
111
- "yargs": "^18.0.0"
111
+ "yargs": "18.0.0"
112
112
  },
113
113
  "optionalDependencies": {
114
114
  "@lmdb/lmdb-linux-x64": "3.4.2",
115
- "@rollup/rollup-darwin-arm64": "4.46.2",
116
- "@rollup/rollup-linux-x64-gnu": "4.46.2",
117
- "@rollup/rollup-win32-x64": "4.9.5"
115
+ "@rollup/rollup-darwin-arm64": "4.60.1",
116
+ "@rollup/rollup-linux-x64-gnu": "4.60.1",
117
+ "@rollup/rollup-win32-x64": "4.60.1"
118
118
  },
119
119
  "engines": {
120
120
  "node": "22.18.0",
121
121
  "npm": "10.9.3"
122
122
  },
123
123
  "overrides": {
124
- "ng-packagr": {
125
- "@rollup/wasm-node": "4.40.2"
126
- }
124
+ "ajv": "8.18.0",
125
+ "picomatch": "4.0.4",
126
+ "postcss": "8.5.13",
127
+ "uuid": "14.0.0",
128
+ "vite": "7.3.2"
127
129
  },
128
130
  "engineStrict": true
129
131
  }
@@ -0,0 +1,13 @@
1
+ // Default WMAppProperties - will be overridden by application-specific properties
2
+ export const WMAppProperties = {
3
+ name: 'wavemaker-ng-runtime',
4
+ type: 'APPLICATION',
5
+ platformType: 'WEB',
6
+ supportedLanguages: {
7
+ 'en': { moment: 'en' }
8
+ },
9
+ languageBundleSources: 'STATIC',
10
+ preferredLanguage: 'en',
11
+ fontConfig: {}
12
+ };
13
+
@@ -1,44 +1,70 @@
1
- import { ComponentFactoryResolver, Injectable, Inject } from '@angular/core';
1
+ import { Injectable, Inject, Type } from '@angular/core';
2
2
 
3
3
  import { ComponentRefProvider, ComponentType } from '@wm/runtime/base';
4
4
  import { LazyComponentRefProviderService } from './lazy-component-ref-provider.service';
5
5
 
6
- const componentRefCache = new Map<ComponentType, Map<string, any>>();
6
+ interface ComponentCacheEntry {
7
+ ref: Type<unknown>;
8
+ componentFactory?: any; // Legacy support for non-standalone components
9
+ }
10
+
11
+ const componentCache = new Map<ComponentType, Map<string, ComponentCacheEntry>>();
7
12
 
8
- componentRefCache.set(ComponentType.PAGE, new Map<string, any>());
9
- componentRefCache.set(ComponentType.PARTIAL, new Map<string, any>());
10
- componentRefCache.set(ComponentType.PREFAB, new Map<string, any>());
13
+ componentCache.set(ComponentType.PAGE, new Map<string, ComponentCacheEntry>());
14
+ componentCache.set(ComponentType.PARTIAL, new Map<string, ComponentCacheEntry>());
15
+ componentCache.set(ComponentType.PREFAB, new Map<string, ComponentCacheEntry>());
11
16
 
12
17
  @Injectable()
13
18
  export class ComponentRefProviderService extends ComponentRefProvider {
14
19
 
15
- static registerComponentRef(name: string, type: ComponentType, ref: any, componentFactory?: any) {
16
- componentRefCache.get(type).set(name, {ref: ref, componentFactory: componentFactory});
20
+ /**
21
+ * Register a component class for dynamic instantiation
22
+ * @param name - Component name identifier
23
+ * @param type - Component type (PAGE, PARTIAL, PREFAB)
24
+ * @param ref - Component class reference
25
+ * @param componentFactory - Optional legacy component factory (for backward compatibility)
26
+ */
27
+ static registerComponentRef(name: string, type: ComponentType, ref: Type<unknown>, componentFactory?: any): void {
28
+ componentCache.get(type).set(name, { ref, componentFactory });
17
29
  }
18
30
 
19
- constructor(private componentFactoryResolver: ComponentFactoryResolver, @Inject(LazyComponentRefProviderService) private lazyComponentRef) {
31
+ constructor(@Inject(LazyComponentRefProviderService) private lazyComponentLoader: LazyComponentRefProviderService) {
20
32
  super();
21
33
  }
22
34
 
23
- public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: {}): Promise<any> {
24
- const value = componentRefCache.get(componentType).get(componentName);
25
- if (!value && (componentType === ComponentType.PARTIAL || componentType === ComponentType.PREFAB)) {
26
- const partialRef = await this.lazyComponentRef.getComponentFactoryRef(
35
+ /**
36
+ * Get component class for dynamic instantiation
37
+ * Returns the component Type which can be used with ViewContainerRef.createComponent()
38
+ *
39
+ * @param componentName - Name of the component to load
40
+ * @param componentType - Type of component (PAGE, PARTIAL, PREFAB)
41
+ * @param options - Additional options (e.g., prefab name for partial resolution)
42
+ * @returns Promise resolving to component Type or null if not found
43
+ */
44
+ public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Record<string, unknown>): Promise<Type<unknown> | null> {
45
+ const cachedEntry = componentCache.get(componentType)?.get(componentName);
46
+
47
+ // Try lazy loading for PARTIAL and PREFAB types if not in cache
48
+ if (!cachedEntry && (componentType === ComponentType.PARTIAL || componentType === ComponentType.PREFAB)) {
49
+ const lazyComponent = await this.lazyComponentLoader.getComponentFactoryRef(
27
50
  componentName,
28
51
  componentType,
29
52
  options
30
53
  );
31
- if (partialRef) {
32
- return Promise.resolve(partialRef);
54
+ if (lazyComponent) {
55
+ return lazyComponent;
33
56
  }
34
57
  }
35
- // Guard against undefined value
36
- if (!value) {
37
- return Promise.resolve(null);
38
- }
39
- if (!value.componentFactory) {
40
- value.componentFactory = this.componentFactoryResolver.resolveComponentFactory(value.ref);
58
+
59
+ // Return null if component not found
60
+ if (!cachedEntry) {
61
+ console.warn(`Component not found: ${componentName} (type: ${componentType})`);
62
+ return null;
41
63
  }
42
- return Promise.resolve(value.componentFactory);
64
+
65
+ // Return component class (modern Angular 13+ approach for standalone components)
66
+ // For legacy components, the componentFactory would be used, but we return the ref
67
+ // as createComponent() handles both standalone and non-standalone components
68
+ return cachedEntry.ref;
43
69
  }
44
70
  }
@@ -1,35 +1,57 @@
1
- import { Injectable, ComponentFactoryResolver } from '@angular/core';
1
+ import { Injectable, Type } from '@angular/core';
2
2
  import { PartialRefProvider } from '@wm/core';
3
3
  import { ComponentType } from '@wm/runtime/base';
4
4
  import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
5
5
 
6
- type Options = {
7
- prefab: string
8
- };
6
+ interface LazyLoadOptions {
7
+ prefab?: string;
8
+ }
9
+
10
+ interface LazyModule {
11
+ loadComponent: () => Promise<Type<unknown>>;
12
+ }
9
13
 
10
14
  @Injectable({
11
15
  providedIn: 'root'
12
16
  })
13
17
  export class LazyComponentRefProviderService extends PartialRefProvider {
14
- constructor(
15
- private componentFactoryResolver: ComponentFactoryResolver
16
- ) {
18
+ constructor() {
17
19
  super();
18
20
  }
19
21
 
20
- private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
21
- if (componentType === ComponentType.PARTIAL && options && options.prefab) {
22
+ /**
23
+ * Resolve the appropriate lazy module based on component type and options
24
+ * @private
25
+ */
26
+ private getLazyModule(componentName: string, componentType: ComponentType, options?: LazyLoadOptions): LazyModule | undefined {
27
+ // Prefab-scoped partial (e.g., partial inside a prefab)
28
+ if (componentType === ComponentType.PARTIAL && options?.prefab) {
22
29
  return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
23
30
  }
31
+
32
+ // Standard partial
24
33
  if (componentType === ComponentType.PARTIAL) {
25
34
  return partialLazyModules[componentName];
26
35
  }
36
+
37
+ // Prefab
27
38
  if (componentType === ComponentType.PREFAB) {
28
39
  return prefabLazyModules[componentName];
29
40
  }
41
+
42
+ return undefined;
30
43
  }
31
44
 
32
- public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
45
+ /**
46
+ * Lazy load and return a component class
47
+ * Returns the component Type which can be used with ViewContainerRef.createComponent()
48
+ *
49
+ * @param componentName - Name of the component to lazy load
50
+ * @param componentType - Type of component (PARTIAL, PREFAB)
51
+ * @param options - Additional options (e.g., prefab name for partial resolution)
52
+ * @returns Promise resolving to component Type or null if loading fails
53
+ */
54
+ public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: LazyLoadOptions): Promise<Type<unknown> | null> {
33
55
  try {
34
56
  const lazyModule = this.getLazyModule(componentName, componentType, options);
35
57
 
@@ -38,18 +60,19 @@ export class LazyComponentRefProviderService extends PartialRefProvider {
38
60
  return null;
39
61
  }
40
62
 
41
- // Load the component
42
- const loadedComponent = await lazyModule.loadComponent();
63
+ // Dynamically load the component class
64
+ const componentClass = await lazyModule.loadComponent();
43
65
 
44
- if (!loadedComponent) {
45
- console.error(`Failed to load component ${componentName}`);
66
+ if (!componentClass) {
67
+ console.error(`Failed to load component class: ${componentName}`);
46
68
  return null;
47
69
  }
48
70
 
49
- // For standalone components, create a component factory
50
- return this.componentFactoryResolver.resolveComponentFactory(loadedComponent);
51
- } catch (e) {
52
- console.error('Error in getComponentFactoryRef:', e);
71
+ // Return the component class directly (Angular 13+ standalone component approach)
72
+ // This can be used directly with ViewContainerRef.createComponent()
73
+ return componentClass;
74
+ } catch (error) {
75
+ console.error(`Error lazy loading component ${componentName}:`, error);
53
76
  return null;
54
77
  }
55
78
  }
@@ -69,7 +69,7 @@ import "jquery-ui/ui/widgets/resizable.js";
69
69
  import "jquery-ui/ui/widgets/sortable.js";
70
70
  import "jquery-ui/ui/widgets/draggable.js";
71
71
  import "jquery-ui/ui/widgets/droppable.js";
72
- import "libraries/scripts/jquery.ui.touch-punch/jquery.ui.touch-punch.min.js";
72
+ import "projects/jquery.ui.touch-punch/jquery.ui.touch-punch.min.js";
73
73
  import "moment-timezone/builds/moment-timezone.min.js";
74
74
  import "iscroll/build/iscroll.js";
75
75
  import "tabbable/dist/index.umd.min.js";
@@ -0,0 +1,27 @@
1
+ // Global type declarations for jQuery extensions
2
+ // Using declaration merging to extend existing jQuery types
3
+
4
+ declare global {
5
+ interface JQueryStatic {
6
+ ui?: {
7
+ widget?: any;
8
+ [key: string]: any;
9
+ };
10
+ }
11
+
12
+ interface JQuery {
13
+ DataTable?(options?: any): any;
14
+ destroy?(): void;
15
+ datatable?(method: string, ...args: any[]): any;
16
+ datatable?(options?: any): any;
17
+ }
18
+
19
+ // Extend jQuery.fn namespace for DataTable plugin
20
+ namespace JQueryStatic {
21
+ interface fn {
22
+ DataTable?: any;
23
+ }
24
+ }
25
+ }
26
+
27
+ export {};
@@ -89,6 +89,6 @@
89
89
  "angularCompilerOptions": {
90
90
  "compilationMode": "full",
91
91
  "strictMetadataEmit": false,
92
- "fullTemplateTypeCheck": false
92
+ "strictTemplates": false
93
93
  }
94
94
  }