@wavemaker/angular-codegen 11.15.6-rc.647667 → 11.16.0-rc.269

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.
Files changed (39) hide show
  1. package/angular-app/build-scripts/build.js +18 -1
  2. package/angular-app/build-scripts/ng-circle-progress-patch.mjs +38 -0
  3. package/angular-app/build-scripts/ngx-bootstrap-patch.mjs +308 -0
  4. package/angular-app/dependency-report.html +1 -1
  5. package/angular-app/npm-shrinkwrap.json +14517 -16192
  6. package/angular-app/package-lock.json +14517 -16192
  7. package/angular-app/package.json +48 -44
  8. package/angular-app/src/assets/styles/css/wm-responsive.css +1 -1
  9. package/angular-app/src/assets/styles/css/wm-style.css +56 -1
  10. package/angular-app/src/framework/services/component-ref-provider.service.ts +8 -3
  11. package/angular-app/src/framework/services/lazy-component-ref-provider.service.ts +5 -8
  12. package/angular-app/src/setup-jest.js +26 -0
  13. package/angular-app/tsconfig.json +5 -2
  14. package/angular-app/tsconfig.web-app.json +11 -5
  15. package/build-angular-app.js +2 -2
  16. package/dependencies/custom-widgets-bundle.cjs.js +14 -37
  17. package/dependencies/expression-parser.cjs.js +81671 -27260
  18. package/dependencies/pipe-provider.cjs.js +206101 -196686
  19. package/dependencies/transpilation-web.cjs.js +60795 -80092
  20. package/npm-shrinkwrap.json +2154 -2399
  21. package/package-lock.json +2154 -2399
  22. package/package.json +15 -10
  23. package/src/codegen-args-cli.js +1 -1
  24. package/src/expr-parser-utils.js +1 -1
  25. package/src/gen-app-override-css.js +1 -1
  26. package/src/gen-app-skeleton.js +1 -1
  27. package/src/gen-components.js +1 -1
  28. package/src/gen-layouts.js +1 -1
  29. package/src/handlebar-helpers.js +1 -1
  30. package/src/pages-util.js +1 -1
  31. package/src/project-meta.js +1 -1
  32. package/src/update-angular-json.js +1 -1
  33. package/src/wm-utils.js +1 -1
  34. package/templates/app.config.ts.hbs +11 -6
  35. package/templates/customwidget/customwidget.component.ts.hbs +2 -1
  36. package/templates/layout/layout.component.ts.hbs +2 -1
  37. package/templates/page/page.component.ts.hbs +2 -1
  38. package/templates/partial/partial.component.ts.hbs +2 -1
  39. package/templates/prefab/prefab.component.ts.hbs +2 -1
@@ -1,4 +1,4 @@
1
- import { ComponentFactoryResolver, Injectable, Inject } from '@angular/core';
1
+ import { Injectable, Inject } from '@angular/core';
2
2
 
3
3
  import { ComponentRefProvider, ComponentType } from '@wm/runtime/base';
4
4
  import { LazyComponentRefProviderService } from './lazy-component-ref-provider.service';
@@ -16,7 +16,7 @@ export class ComponentRefProviderService extends ComponentRefProvider {
16
16
  componentRefCache.get(type).set(name, {ref: ref, componentFactory: componentFactory});
17
17
  }
18
18
 
19
- constructor(private componentFactoryResolver: ComponentFactoryResolver, @Inject(LazyComponentRefProviderService) private lazyComponentRef) {
19
+ constructor(@Inject(LazyComponentRefProviderService) private lazyComponentRef) {
20
20
  super();
21
21
  }
22
22
 
@@ -36,8 +36,13 @@ export class ComponentRefProviderService extends ComponentRefProvider {
36
36
  if (!value) {
37
37
  return Promise.resolve(null);
38
38
  }
39
+ // Angular 22 removed ComponentFactoryResolver / ComponentFactory-based createComponent()
40
+ // entirely — value.ref is already a component class (registered via
41
+ // ComponentRefProviderService.registerComponentRef), which the new
42
+ // ViewContainerRef.createComponent(Type, options) API accepts directly. No factory
43
+ // resolution step needed at all anymore.
39
44
  if (!value.componentFactory) {
40
- value.componentFactory = this.componentFactoryResolver.resolveComponentFactory(value.ref);
45
+ value.componentFactory = value.ref;
41
46
  }
42
47
  return Promise.resolve(value.componentFactory);
43
48
  }
@@ -1,4 +1,4 @@
1
- import { Injectable, ComponentFactoryResolver } from '@angular/core';
1
+ import { Injectable } 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';
@@ -11,11 +11,6 @@ type Options = {
11
11
  providedIn: 'root'
12
12
  })
13
13
  export class LazyComponentRefProviderService extends PartialRefProvider {
14
- constructor(
15
- private componentFactoryResolver: ComponentFactoryResolver
16
- ) {
17
- super();
18
- }
19
14
 
20
15
  private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
21
16
  if (componentType === ComponentType.PARTIAL && options && options.prefab) {
@@ -46,8 +41,10 @@ export class LazyComponentRefProviderService extends PartialRefProvider {
46
41
  return null;
47
42
  }
48
43
 
49
- // For standalone components, create a component factory
50
- return this.componentFactoryResolver.resolveComponentFactory(loadedComponent);
44
+ // Angular 22 removed ComponentFactoryResolver / ComponentFactory-based createComponent()
45
+ // entirely — loadedComponent is already a component class, which the new
46
+ // ViewContainerRef.createComponent(Type, options) API accepts directly.
47
+ return loadedComponent;
51
48
  } catch (e) {
52
49
  console.error('Error in getComponentFactoryRef:', e);
53
50
  return null;
@@ -118,4 +118,30 @@ Object.defineProperty(global.HTMLMediaElement.prototype, 'addTextTrack', {
118
118
  value: jest.fn(),
119
119
  });
120
120
 
121
+ // jsdom has no layout engine: Element.prototype.getClientRects() always returns an
122
+ // empty list, regardless of the element's actual content/attachment. tabbable@6+'s
123
+ // default displayCheck: 'full' treats "zero client rects" as hidden, so under jsdom
124
+ // every element looks invisible and @wavemaker/focus-trap's activate() always throws
125
+ // "must have at least one tabbable node" for any real container (e.g. ngx-bootstrap's
126
+ // bs-datepicker-container). This is a jsdom/tabbable interaction, not app behavior --
127
+ // stub a non-empty rect so tabbable's own attribute-based checks (tabindex, disabled,
128
+ // etc.) decide tabbability instead, matching real-browser behavior for elements that
129
+ // are actually attached and not display:none.
130
+ if (!global.Element.prototype.getClientRects || !global.Element.prototype.getClientRects.__wmStub) {
131
+ const originalGetClientRects = global.Element.prototype.getClientRects;
132
+ const stubGetClientRects = function () {
133
+ const real = originalGetClientRects ? originalGetClientRects.call(this) : [];
134
+ if (real && real.length) {
135
+ return real;
136
+ }
137
+ const style = global.getComputedStyle(this);
138
+ if (style.display === 'none' || style.visibility === 'hidden') {
139
+ return [];
140
+ }
141
+ return [{ width: 1, height: 1, top: 0, left: 0, right: 1, bottom: 1, x: 0, y: 0 }];
142
+ };
143
+ stubGetClientRects.__wmStub = true;
144
+ global.Element.prototype.getClientRects = stubGetClientRects;
145
+ }
146
+
121
147
 
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "compileOnSave": false,
3
3
  "compilerOptions": {
4
+ "ignoreDeprecations": "6.0",
5
+ "strict": false,
4
6
  "baseUrl": "./",
5
7
  "downlevelIteration": true,
6
8
  "outDir": "./dist/out-tsc",
@@ -8,7 +10,7 @@
8
10
  "declaration": false,
9
11
  "target": "es2022",
10
12
  "module": "es2022",
11
- "moduleResolution": "node",
13
+ "moduleResolution": "bundler",
12
14
  "esModuleInterop": true,
13
15
  "emitDecoratorMetadata": true,
14
16
  "experimentalDecorators": true,
@@ -89,6 +91,7 @@
89
91
  "angularCompilerOptions": {
90
92
  "compilationMode": "full",
91
93
  "strictMetadataEmit": false,
92
- "fullTemplateTypeCheck": false
94
+ "fullTemplateTypeCheck": false,
95
+ "strictTemplates": false
93
96
  }
94
97
  }
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "compileOnSave": false,
3
3
  "compilerOptions": {
4
+ "ignoreDeprecations": "6.0",
5
+ "strict": false,
4
6
  "baseUrl": "./",
5
7
  "downlevelIteration": true,
6
8
  "outDir": "./dist/out-tsc",
7
9
  "sourceMap": true,
8
10
  "declaration": false,
9
11
  "target": "es2022",
10
- "module": "es2020",
11
- "moduleResolution": "node",
12
+ "module": "es2022",
13
+ "moduleResolution": "bundler",
14
+ "esModuleInterop": true,
12
15
  "emitDecoratorMetadata": true,
13
16
  "experimentalDecorators": true,
14
17
  "typeRoots": [
15
18
  "node_modules/@types"
16
19
  ],
17
20
  "lib": [
18
- "es2018",
21
+ "es2022",
19
22
  "dom"
20
23
  ],
21
24
  "paths": {
@@ -73,9 +76,12 @@
73
76
  "@wm/runtime/dynamic": [
74
77
  "node_modules/@wavemaker/app-ng-runtime/runtime/dynamic"
75
78
  ]
76
- }
79
+ },
80
+ "useDefineForClassFields": false
77
81
  },
78
82
  "angularCompilerOptions": {
79
- "compilationMode": "full"
83
+ "compilationMode": "full",
84
+ "fullTemplateTypeCheck": false,
85
+ "strictTemplates": false
80
86
  }
81
87
  }
@@ -82,9 +82,9 @@ const processAngularAppPackage = async (sourcePath, targetPath, packageName, isO
82
82
  // Install dependencies
83
83
  const installPath = isOptimized ? sourcePath : targetPath;
84
84
  try {
85
- if (global.buildConfigObj.runInspection && !isOptimized && fs.existsSync(path.join(global.buildConfigObj.appSrc, "build-src/package-override.json")) && fs.existsSync(path.join(installPath, 'package.json'))) {
85
+ if (!isOptimized && fs.existsSync(path.join(global.buildConfigObj.appSrc, "build-src/package-override.json")) && fs.existsSync(path.join(installPath, 'package.json'))) {
86
86
  let packageJson = JSON.parse(fs.readFileSync(path.join(installPath, 'package.json'), 'utf8'));
87
- packageJson = await mergePackageJsonWithOverrideJson(global.buildConfigObj.appSrc, packageJson);
87
+ packageJson = await mergePackageJsonWithOverrideJson(global.buildConfigObj.appSrc, packageJson, global.buildConfigObj.runInspection);
88
88
  fs.writeFileSync(path.join(installPath, 'package.json'), JSON.stringify(packageJson, null, 4));
89
89
  console.log("Successfully updated generated-app package.json with package-override.json");
90
90
  }