@wavemaker/angular-app 12.0.0-next.141221 → 12.0.0-next.25480
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/angular.json +66 -106
- package/build-scripts/build.js +1 -0
- package/build-scripts/index-html-transform-ng-serve.ts +20 -0
- package/build-scripts/post-build.js +16 -112
- package/dependencies/app.component.html +37 -25
- package/dependencies/custom-widgets-bundle.cjs.js +415 -0
- package/dependencies/expression-parser.cjs.js +499 -17432
- package/dependencies/pipe-provider.cjs.js +68323 -66880
- package/dependencies/transpilation-web.cjs.js +16669 -15184
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +10724 -12052
- package/package-lock.json +10724 -12052
- package/package.json +66 -80
- package/proxy.conf.js +14 -0
- package/src/app/lazy-load-scripts.resolve.ts +2 -9
- package/src/framework/services/component-ref-provider.service.ts +4 -0
- package/src/framework/services/customwidget-config-provider.service.ts +13 -0
- package/src/framework/services/lazy-component-ref-provider.service.ts +22 -30
- package/src/framework/util/page-util.ts +3 -1
- package/src/index.html +1 -1
- package/src/main.ts +35 -32
- package/src/setup-jest.js +10 -10
- package/tsconfig.json +9 -36
- package/tsconfig.web-app.json +2 -23
- package/wm-custom-webpack.config.js +13 -56
- package/dependencies/transpilation-mobile.cjs.js +0 -93600
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/angular-app",
|
|
3
|
-
"version": "12.0.0-next.
|
|
3
|
+
"version": "12.0.0-next.25480",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"ng": "ng",
|
|
6
6
|
"start": "./node_modules/.bin/ng serve",
|
|
@@ -30,114 +30,100 @@
|
|
|
30
30
|
"@angular/platform-browser-dynamic": "18.2.13",
|
|
31
31
|
"@angular/router": "18.2.13",
|
|
32
32
|
"@angular/service-worker": "18.2.13",
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@awesome-cordova-plugins/device": "5.39.1",
|
|
39
|
-
"@awesome-cordova-plugins/diagnostic": "5.39.1",
|
|
40
|
-
"@awesome-cordova-plugins/file": "5.39.1",
|
|
41
|
-
"@awesome-cordova-plugins/file-opener": "5.39.1",
|
|
42
|
-
"@awesome-cordova-plugins/geolocation": "5.39.1",
|
|
43
|
-
"@awesome-cordova-plugins/location-accuracy": "5.39.1",
|
|
44
|
-
"@awesome-cordova-plugins/media-capture": "5.39.1",
|
|
45
|
-
"@awesome-cordova-plugins/network": "5.39.1",
|
|
46
|
-
"@awesome-cordova-plugins/sqlite": "5.39.1",
|
|
47
|
-
"@awesome-cordova-plugins/vibration": "5.39.1",
|
|
48
|
-
"@babel/runtime": "7.14.8",
|
|
33
|
+
"@fullcalendar/core": "6.1.18",
|
|
34
|
+
"@fullcalendar/daygrid": "6.1.18",
|
|
35
|
+
"@fullcalendar/interaction": "6.1.18",
|
|
36
|
+
"@fullcalendar/list": "6.1.18",
|
|
37
|
+
"@fullcalendar/timegrid": "6.1.18",
|
|
49
38
|
"@metrichor/jmespath": "0.3.1",
|
|
39
|
+
"@wavemaker/custom-widgets-m3": "12.0.0-next.25480",
|
|
50
40
|
"@wavemaker/focus-trap": "1.0.1",
|
|
51
|
-
"@wavemaker/
|
|
52
|
-
"@wavemaker/
|
|
41
|
+
"@wavemaker/foundation-css": "12.0.0-next.25480",
|
|
42
|
+
"@wavemaker/nvd3": "1.8.16",
|
|
43
|
+
"@wavemaker/variables": "12.0.0-next.25480",
|
|
53
44
|
"@ztree/ztree_v3": "3.5.48",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
45
|
+
"acorn": "^8.15.0",
|
|
46
|
+
"angular-imask": "7.6.1",
|
|
47
|
+
"angular2-websocket": "0.9.8",
|
|
57
48
|
"d3": "7.8.5",
|
|
58
|
-
"fullcalendar": "5.3.1",
|
|
59
|
-
"hammerjs": "2.0.8",
|
|
60
49
|
"iscroll": "5.2.0",
|
|
61
50
|
"jquery": "3.7.1",
|
|
62
|
-
"jquery-ui": "1.
|
|
63
|
-
"
|
|
64
|
-
"jssha": "3.1.2",
|
|
65
|
-
"lodash": "4.17.21",
|
|
51
|
+
"jquery-ui": "1.14.1",
|
|
52
|
+
"jssha": "3.3.1",
|
|
66
53
|
"lodash-es": "4.17.21",
|
|
54
|
+
"moment": "2.30.1",
|
|
55
|
+
"moment-timezone": "^0.6.0",
|
|
67
56
|
"ng-circle-progress": "1.7.1",
|
|
68
57
|
"ngx-bootstrap": "9.0.0",
|
|
69
|
-
"ngx-color-picker": "
|
|
70
|
-
"ngx-toastr": "
|
|
71
|
-
"rxjs": "
|
|
72
|
-
"rxjs-compat": "6.4.0",
|
|
58
|
+
"ngx-color-picker": "20.1.1",
|
|
59
|
+
"ngx-toastr": "19.0.0",
|
|
60
|
+
"rxjs": "7.8.2",
|
|
73
61
|
"summernote": "0.9.1",
|
|
74
|
-
"
|
|
75
|
-
"tslib": "2.4.1",
|
|
62
|
+
"tslib": "2.8.1",
|
|
76
63
|
"x2js": "3.4.4",
|
|
77
|
-
"zone.js": "0.
|
|
78
|
-
"@wavemaker/app-ng-runtime": "12.0.0-next.
|
|
64
|
+
"zone.js": "0.15.1",
|
|
65
|
+
"@wavemaker/app-ng-runtime": "12.0.0-next.25480"
|
|
79
66
|
},
|
|
80
67
|
"devDependencies": {
|
|
81
68
|
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
|
|
82
69
|
"@angular-builders/custom-webpack": "18.0.0",
|
|
83
|
-
"@angular-devkit/build-angular": "18.2.
|
|
84
|
-
"@angular-eslint/builder": "
|
|
85
|
-
"@angular-eslint/eslint-plugin": "
|
|
86
|
-
"@angular-eslint/eslint-plugin-template": "
|
|
87
|
-
"@angular-eslint/schematics": "
|
|
88
|
-
"@angular-eslint/template-parser": "
|
|
70
|
+
"@angular-devkit/build-angular": "18.2.20",
|
|
71
|
+
"@angular-eslint/builder": "20.1.1",
|
|
72
|
+
"@angular-eslint/eslint-plugin": "20.1.1",
|
|
73
|
+
"@angular-eslint/eslint-plugin-template": "20.1.1",
|
|
74
|
+
"@angular-eslint/schematics": "20.1.1",
|
|
75
|
+
"@angular-eslint/template-parser": "20.1.1",
|
|
89
76
|
"@angular/cli": "18.2.12",
|
|
90
77
|
"@angular/compiler-cli": "18.2.13",
|
|
91
78
|
"@angular/language-service": "18.2.13",
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@rollup/plugin-
|
|
95
|
-
"@rollup/plugin-
|
|
96
|
-
"@rollup/plugin-
|
|
97
|
-
"@rollup/plugin-
|
|
98
|
-
"@types/jest": "^
|
|
99
|
-
"@types/jquery": "3.
|
|
79
|
+
"@compodoc/compodoc": "^1.1.26",
|
|
80
|
+
"@rollup/plugin-alias": "5.1.1",
|
|
81
|
+
"@rollup/plugin-commonjs": "28.0.6",
|
|
82
|
+
"@rollup/plugin-multi-entry": "6.0.1",
|
|
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",
|
|
100
87
|
"@types/lodash-es": "4.17.12",
|
|
101
|
-
"@types/node": "
|
|
102
|
-
"@
|
|
103
|
-
"@typescript-eslint/
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"codelyzer": "5.1.2",
|
|
108
|
-
"compression-webpack-plugin": "10.0.0",
|
|
109
|
-
"dependency-cruiser": "16.8.0",
|
|
88
|
+
"@types/node": "^24.2.0",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
90
|
+
"@typescript-eslint/parser": "8.39.0",
|
|
91
|
+
"cheerio": "1.1.2",
|
|
92
|
+
"compression-webpack-plugin": "11.1.0",
|
|
93
|
+
"core-js": "3.45.0",
|
|
110
94
|
"eslint": "^8.45.0",
|
|
111
95
|
"fs": "0.0.1-security",
|
|
112
|
-
"fs-extra": "
|
|
113
|
-
"jest": "^
|
|
96
|
+
"fs-extra": "11.3.1",
|
|
97
|
+
"jest": "^30.0.5",
|
|
114
98
|
"jest-canvas-mock": "^2.5.2",
|
|
115
|
-
"jest-
|
|
99
|
+
"jest-environment-jsdom": "^30.0.5",
|
|
100
|
+
"jest-preset-angular": "^15.0.0",
|
|
116
101
|
"license-checker": "25.0.1",
|
|
117
|
-
"moment": "2.
|
|
118
|
-
"moment-timezone": "^0.5.34",
|
|
102
|
+
"moment-locales-webpack-plugin": "^1.2.0",
|
|
119
103
|
"ng-packagr": "17.3.0",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"tslint": "~6.1.0",
|
|
129
|
-
"typescript": "5.4.5",
|
|
130
|
-
"util": "0.11.1",
|
|
131
|
-
"yargs": "^17.3.1"
|
|
104
|
+
"owasp-dependency-check": "0.8.1",
|
|
105
|
+
"rimraf": "6.0.1",
|
|
106
|
+
"rollup": "4.46.2",
|
|
107
|
+
"sonarqube-scanner": "3.5.0",
|
|
108
|
+
"terser": "^5.43.1",
|
|
109
|
+
"typescript": "5.5.4",
|
|
110
|
+
"util": "0.12.5",
|
|
111
|
+
"yargs": "^18.0.0"
|
|
132
112
|
},
|
|
133
113
|
"optionalDependencies": {
|
|
134
|
-
"@
|
|
135
|
-
"@rollup/rollup-
|
|
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",
|
|
136
117
|
"@rollup/rollup-win32-x64": "4.9.5"
|
|
137
118
|
},
|
|
138
119
|
"engines": {
|
|
139
|
-
"node": "
|
|
140
|
-
"npm": "
|
|
120
|
+
"node": "22.18.0",
|
|
121
|
+
"npm": "10.9.3"
|
|
122
|
+
},
|
|
123
|
+
"overrides": {
|
|
124
|
+
"ng-packagr": {
|
|
125
|
+
"@rollup/wasm-node": "4.40.2"
|
|
126
|
+
}
|
|
141
127
|
},
|
|
142
128
|
"engineStrict": true
|
|
143
129
|
}
|
package/proxy.conf.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"/services": {
|
|
3
|
+
target: "https://<your-deployed-app-url>/",
|
|
4
|
+
secure: true,
|
|
5
|
+
changeOrigin: true
|
|
6
|
+
},
|
|
7
|
+
"/j_spring_security_check": {
|
|
8
|
+
target: "https://<your-deployed-app-url>/",
|
|
9
|
+
secure: true,
|
|
10
|
+
changeOrigin: true,
|
|
11
|
+
cookiePathRewrite: "/",
|
|
12
|
+
cookieDomainRewrite: "localhost"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ScriptLoaderService } from '@wm/core';
|
|
3
|
+
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
@Injectable()
|
|
@@ -8,13 +9,5 @@ export class LazyLoadScriptsResolve {
|
|
|
8
9
|
constructor(private scriptLoaderService: ScriptLoaderService) {}
|
|
9
10
|
|
|
10
11
|
async resolve() {
|
|
11
|
-
const scriptsToLoad = [];
|
|
12
|
-
if(isMobileApp()) {
|
|
13
|
-
scriptsToLoad.push('node_modules-hammerjs-hammer.min.js');
|
|
14
|
-
scriptsToLoad.push('node_modules-iscroll-build-iscroll.js');
|
|
15
|
-
}
|
|
16
|
-
if (scriptsToLoad.length > 0) {
|
|
17
|
-
await this.scriptLoaderService.load(...scriptsToLoad);
|
|
18
|
-
}
|
|
19
12
|
}
|
|
20
13
|
}
|
|
@@ -32,6 +32,10 @@ export class ComponentRefProviderService extends ComponentRefProvider {
|
|
|
32
32
|
return Promise.resolve(partialRef);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
// Guard against undefined value
|
|
36
|
+
if (!value) {
|
|
37
|
+
return Promise.resolve(null);
|
|
38
|
+
}
|
|
35
39
|
if (!value.componentFactory) {
|
|
36
40
|
value.componentFactory = this.componentFactoryResolver.resolveComponentFactory(value.ref);
|
|
37
41
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { CustomwidgetConfigProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
import { getCustomWidgetConfig } from '../util/page-util';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class CustomwidgetConfigProviderService extends CustomwidgetConfigProvider {
|
|
9
|
+
|
|
10
|
+
public getConfig(widgetname: string): Promise<any> {
|
|
11
|
+
return Promise.resolve(getCustomWidgetConfig(widgetname));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Injectable,
|
|
3
|
-
NgModuleRef,
|
|
4
|
-
Type,
|
|
5
|
-
Injector,
|
|
6
|
-
Compiler,
|
|
7
|
-
NgModuleFactory,
|
|
8
|
-
} from '@angular/core';
|
|
1
|
+
import { Injectable, ComponentFactoryResolver } from '@angular/core';
|
|
9
2
|
import { PartialRefProvider } from '@wm/core';
|
|
10
3
|
import { ComponentType } from '@wm/runtime/base';
|
|
11
4
|
import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
|
|
12
5
|
|
|
13
|
-
type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
|
|
14
6
|
type Options = {
|
|
15
7
|
prefab: string
|
|
16
8
|
};
|
|
@@ -19,15 +11,15 @@ type Options = {
|
|
|
19
11
|
providedIn: 'root'
|
|
20
12
|
})
|
|
21
13
|
export class LazyComponentRefProviderService extends PartialRefProvider {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
private componentFactoryResolver: ComponentFactoryResolver
|
|
16
|
+
) {
|
|
25
17
|
super();
|
|
26
18
|
}
|
|
27
19
|
|
|
28
20
|
private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
|
|
29
21
|
if (componentType === ComponentType.PARTIAL && options && options.prefab) {
|
|
30
|
-
|
|
22
|
+
return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
|
|
31
23
|
}
|
|
32
24
|
if (componentType === ComponentType.PARTIAL) {
|
|
33
25
|
return partialLazyModules[componentName];
|
|
@@ -37,27 +29,27 @@ export class LazyComponentRefProviderService extends PartialRefProvider {
|
|
|
37
29
|
}
|
|
38
30
|
}
|
|
39
31
|
|
|
40
|
-
private async getModuleFactory(moduleOrFactory: NgModuleFactory<any> | Type<any>): Promise<NgModuleFactory<any>> {
|
|
41
|
-
if (moduleOrFactory instanceof NgModuleFactory) {
|
|
42
|
-
return moduleOrFactory;
|
|
43
|
-
} else {
|
|
44
|
-
return this.compiler.compileModuleAsync(moduleOrFactory);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
32
|
public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
|
|
49
33
|
try {
|
|
50
|
-
const
|
|
51
|
-
|
|
34
|
+
const lazyModule = this.getLazyModule(componentName, componentType, options);
|
|
35
|
+
|
|
36
|
+
if (!lazyModule) {
|
|
37
|
+
console.error(`No lazy module found for ${componentName}`);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Load the component
|
|
42
|
+
const loadedComponent = await lazyModule.loadComponent();
|
|
43
|
+
|
|
44
|
+
if (!loadedComponent) {
|
|
45
|
+
console.error(`Failed to load component ${componentName}`);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
.rootComponent;
|
|
56
|
-
return this.moduleRef.componentFactoryResolver.resolveComponentFactory(
|
|
57
|
-
rootComponent
|
|
58
|
-
);
|
|
49
|
+
// For standalone components, create a component factory
|
|
50
|
+
return this.componentFactoryResolver.resolveComponentFactory(loadedComponent);
|
|
59
51
|
} catch (e) {
|
|
60
|
-
console.error(e);
|
|
52
|
+
console.error('Error in getComponentFactoryRef:', e);
|
|
61
53
|
return null;
|
|
62
54
|
}
|
|
63
55
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const prefabConfigs = new Map<string, any>();
|
|
2
|
+
const customWidgetConfigs = new Map<string, any>();
|
|
2
3
|
|
|
3
4
|
export const registerPrefabConfig = (prefabName: string, config: any) => prefabConfigs.set(prefabName, config);
|
|
4
5
|
export const getPrefabConfig = prefabName => prefabConfigs.get(prefabName);
|
|
5
|
-
|
|
6
|
+
export const registerCustomWidgetConfig = (customWidget: string, config: any) => customWidgetConfigs.set(customWidget, config);
|
|
7
|
+
export const getCustomWidgetConfig = customWidget => customWidgetConfigs.get(customWidget);
|
package/src/index.html
CHANGED
package/src/main.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { ApplicationRef, enableProdMode
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { AppModule } from './app/app.module';
|
|
1
|
+
import { ApplicationRef, enableProdMode } from '@angular/core';
|
|
2
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
5
3
|
import { environment } from './environments/environment';
|
|
6
|
-
|
|
7
4
|
import initWmProjectProperties from './app/wm-project-properties';
|
|
8
5
|
import { WMAppProperties } from './app/wmProperties';
|
|
9
6
|
import * as fontConfig from './font.config';
|
|
7
|
+
import { appConfig } from './app/app.config';
|
|
8
|
+
import { AppComponent } from '@wm/runtime/base';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
// Format Accept-Language header
|
|
11
|
+
const formatAcceptHeader = (languages: string[]): string => {
|
|
12
|
+
const result: string[] = [];
|
|
13
|
+
const addedLanguages = new Set<string>(); // To track already added languages
|
|
15
14
|
let qValue = 1.0;
|
|
16
15
|
|
|
17
|
-
languages.forEach((lang:
|
|
16
|
+
languages.forEach((lang: string) => {
|
|
18
17
|
if (!addedLanguages.has(lang)) {
|
|
19
18
|
// Add the full language (e.g., en-US or en) if not already added
|
|
20
19
|
result.push(`${lang}${qValue === 1.0 ? '' : `;q=${qValue.toFixed(1)}`}`);
|
|
@@ -37,31 +36,35 @@ let formatAcceptHeader = (languages: any) => {
|
|
|
37
36
|
});
|
|
38
37
|
|
|
39
38
|
return result.join(',');
|
|
40
|
-
}
|
|
41
|
-
WMAppProperties['preferredLanguage'] = formatAcceptHeader(navigator.languages);
|
|
42
|
-
WMAppProperties['fontConfig'] = fontConfig;
|
|
43
|
-
|
|
39
|
+
};
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
// Initialize WMAppProperties
|
|
42
|
+
WMAppProperties['preferredLanguage'] = formatAcceptHeader((navigator as any).languages);
|
|
43
|
+
WMAppProperties['fontConfig'] = fontConfig;
|
|
44
|
+
(window as any)._WM_APP_PROPERTIES = WMAppProperties;
|
|
46
45
|
initWmProjectProperties();
|
|
47
46
|
|
|
48
47
|
if (environment.production) {
|
|
49
|
-
|
|
48
|
+
enableProdMode();
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
// MEMORY LEAK FIX: Store event listener references for cleanup (though these are one-time bootstrap events)
|
|
52
|
+
const boundDOMContentLoadedHandler = () => {
|
|
53
|
+
new Promise<Event | void>(resolve => {
|
|
54
|
+
resolve();
|
|
55
|
+
}).then(() => bootstrapApplication(AppComponent, appConfig))
|
|
56
|
+
.then((appRef: ApplicationRef) => {
|
|
57
|
+
// MEMORY LEAK FIX: Store unload handler reference
|
|
58
|
+
const boundUnloadHandler = () => {
|
|
59
|
+
appRef.components.map(c => c?.destroy());
|
|
60
|
+
// MEMORY LEAK FIX: Remove unload listener after cleanup (though unload is typically final)
|
|
61
|
+
window.removeEventListener('unload', boundUnloadHandler);
|
|
62
|
+
};
|
|
63
|
+
window.addEventListener('unload', boundUnloadHandler);
|
|
64
|
+
})
|
|
65
|
+
.catch(err => console.error('Error bootstrapping app:', err));
|
|
66
|
+
// MEMORY LEAK FIX: Remove DOMContentLoaded listener after execution (one-time event)
|
|
67
|
+
document.removeEventListener('DOMContentLoaded', boundDOMContentLoadedHandler);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
document.addEventListener('DOMContentLoaded', boundDOMContentLoadedHandler);
|
package/src/setup-jest.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
// This file is automatically loaded when running `jest` commands
|
|
3
|
+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
|
|
2
4
|
import { ToastrModule } from 'ngx-toastr';
|
|
3
5
|
import { TestBed } from '@angular/core/testing';
|
|
4
6
|
import _ from 'lodash-es';
|
|
5
7
|
import 'jest-canvas-mock';
|
|
6
8
|
|
|
9
|
+
setupZoneTestEnv();
|
|
10
|
+
|
|
7
11
|
// Mock global objects if necessary
|
|
8
12
|
global.jQuery = require("jquery");
|
|
9
13
|
global.$ = global.jQuery;
|
|
@@ -67,7 +71,6 @@ import "jquery-ui/ui/widgets/draggable.js";
|
|
|
67
71
|
import "jquery-ui/ui/widgets/droppable.js";
|
|
68
72
|
import "libraries/scripts/jquery.ui.touch-punch/jquery.ui.touch-punch.min.js";
|
|
69
73
|
import "moment-timezone/builds/moment-timezone.min.js";
|
|
70
|
-
import "hammerjs/hammer.min.js";
|
|
71
74
|
import "iscroll/build/iscroll.js";
|
|
72
75
|
import "tabbable/dist/index.umd.min.js";
|
|
73
76
|
import "@wavemaker/focus-trap/dist/focus-trap.umd.min.js";
|
|
@@ -81,16 +84,11 @@ beforeEach(() => {
|
|
|
81
84
|
ToastrModule.forRoot(),
|
|
82
85
|
],
|
|
83
86
|
})
|
|
84
|
-
Object.defineProperties(window, {
|
|
85
|
-
location: {
|
|
86
|
-
writable: true,
|
|
87
|
-
value: {
|
|
88
|
-
reload: jest.fn(),
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
87
|
});
|
|
93
88
|
|
|
89
|
+
// Mock window.location for tests
|
|
90
|
+
// We'll use a simpler approach that doesn't try to redefine read-only properties
|
|
91
|
+
// The tests will handle their own window.location mocking as needed
|
|
94
92
|
// jest.setup.js
|
|
95
93
|
Object.defineProperty(global.HTMLMediaElement.prototype, 'load', {
|
|
96
94
|
configurable: true,
|
|
@@ -119,3 +117,5 @@ Object.defineProperty(global.HTMLMediaElement.prototype, 'addTextTrack', {
|
|
|
119
117
|
writable: true,
|
|
120
118
|
value: jest.fn(),
|
|
121
119
|
});
|
|
120
|
+
|
|
121
|
+
|
package/tsconfig.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"sourceMap": true,
|
|
8
8
|
"declaration": false,
|
|
9
9
|
"target": "es2022",
|
|
10
|
-
"module": "
|
|
10
|
+
"module": "es2022",
|
|
11
11
|
"moduleResolution": "node",
|
|
12
12
|
"esModuleInterop": true,
|
|
13
13
|
"emitDecoratorMetadata": true,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"node_modules/@types"
|
|
17
17
|
],
|
|
18
18
|
"lib": [
|
|
19
|
-
"
|
|
19
|
+
"es2022",
|
|
20
20
|
"dom"
|
|
21
21
|
],
|
|
22
22
|
"paths": {
|
|
@@ -32,39 +32,30 @@
|
|
|
32
32
|
"@wm/build-task": [
|
|
33
33
|
"node_modules/@wavemaker/app-ng-runtime/build-task/"
|
|
34
34
|
],
|
|
35
|
-
"@wm/mobile-build-task": [
|
|
36
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile-build-task"
|
|
37
|
-
],
|
|
38
35
|
"@wm/core": [
|
|
39
36
|
"node_modules/@wavemaker/app-ng-runtime/core"
|
|
40
37
|
],
|
|
41
38
|
"@wavemaker/variables": [
|
|
42
39
|
"node_modules/@wavemaker/variables/"
|
|
43
40
|
],
|
|
41
|
+
"@wavemaker/custom-widgets-m3": [
|
|
42
|
+
"node_modules/@wavemaker/custom-widgets-m3/"
|
|
43
|
+
],
|
|
44
44
|
"@wm/components/base": [
|
|
45
45
|
"node_modules/@wavemaker/app-ng-runtime/components/base"
|
|
46
46
|
],
|
|
47
|
-
"@wm/components/basic": [
|
|
48
|
-
"node_modules/@wavemaker/app-ng-runtime/components/basic
|
|
47
|
+
"@wm/components/basic/*": [
|
|
48
|
+
"node_modules/@wavemaker/app-ng-runtime/components/basic/*"
|
|
49
49
|
],
|
|
50
|
-
"@wm/components/input": [
|
|
51
|
-
"node_modules/@wavemaker/app-ng-runtime/components/input
|
|
50
|
+
"@wm/components/input/*": [
|
|
51
|
+
"node_modules/@wavemaker/app-ng-runtime/components/input/*"
|
|
52
52
|
],
|
|
53
53
|
"@wm/components/page": [
|
|
54
54
|
"node_modules/@wavemaker/app-ng-runtime/components/page/default"
|
|
55
55
|
],
|
|
56
|
-
"@wm/mobile/components/basic": [
|
|
57
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components/basic/default"
|
|
58
|
-
],
|
|
59
|
-
"@wm/mobile/components/page": [
|
|
60
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components/page/default"
|
|
61
|
-
],
|
|
62
56
|
"@wm/components/dialogs": [
|
|
63
57
|
"node_modules/@wavemaker/app-ng-runtime/components/dialogs/default"
|
|
64
58
|
],
|
|
65
|
-
"@wm/mobile/components/*": [
|
|
66
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components/*"
|
|
67
|
-
],
|
|
68
59
|
"@wm/components/*": [
|
|
69
60
|
"node_modules/@wavemaker/app-ng-runtime/components/*"
|
|
70
61
|
],
|
|
@@ -86,29 +77,11 @@
|
|
|
86
77
|
"@wm/variables": [
|
|
87
78
|
"node_modules/@wavemaker/app-ng-runtime/variables"
|
|
88
79
|
],
|
|
89
|
-
"@wm/mobile/core": [
|
|
90
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/core"
|
|
91
|
-
],
|
|
92
|
-
"@wm/mobile/components": [
|
|
93
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components"
|
|
94
|
-
],
|
|
95
|
-
"@wm/mobile/offline": [
|
|
96
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/offline"
|
|
97
|
-
],
|
|
98
|
-
"@wm/mobile/variables": [
|
|
99
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/variables"
|
|
100
|
-
],
|
|
101
80
|
"@wm/runtime/base": [
|
|
102
81
|
"node_modules/@wavemaker/app-ng-runtime/runtime/base"
|
|
103
82
|
],
|
|
104
83
|
"@wm/runtime/dynamic": [
|
|
105
84
|
"node_modules/@wavemaker/app-ng-runtime/runtime/dynamic"
|
|
106
|
-
],
|
|
107
|
-
"@wm/mobile/runtime": [
|
|
108
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime"
|
|
109
|
-
],
|
|
110
|
-
"@wm/mobile/runtime/dynamic": [
|
|
111
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime-dynamic"
|
|
112
85
|
]
|
|
113
86
|
},
|
|
114
87
|
"useDefineForClassFields": false
|
package/tsconfig.web-app.json
CHANGED
|
@@ -31,14 +31,11 @@
|
|
|
31
31
|
"@wm/build-task": [
|
|
32
32
|
"node_modules/@wavemaker/app-ng-runtime/build-task/"
|
|
33
33
|
],
|
|
34
|
-
"@wm/mobile-build-task": [
|
|
35
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile-build-task"
|
|
36
|
-
],
|
|
37
34
|
"@wm/core": [
|
|
38
35
|
"node_modules/@wavemaker/app-ng-runtime/core"
|
|
39
36
|
],
|
|
40
|
-
"@wm/components/basic": [
|
|
41
|
-
"node_modules/@wavemaker/app-ng-runtime/components/basic
|
|
37
|
+
"@wm/components/basic/*": [
|
|
38
|
+
"node_modules/@wavemaker/app-ng-runtime/components/basic/*"
|
|
42
39
|
],
|
|
43
40
|
"@wm/components/input": [
|
|
44
41
|
"node_modules/@wavemaker/app-ng-runtime/components/input/default"
|
|
@@ -70,29 +67,11 @@
|
|
|
70
67
|
"@wm/variables": [
|
|
71
68
|
"node_modules/@wavemaker/app-ng-runtime/variables"
|
|
72
69
|
],
|
|
73
|
-
"@wm/mobile/core": [
|
|
74
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/core"
|
|
75
|
-
],
|
|
76
|
-
"@wm/mobile/components": [
|
|
77
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components"
|
|
78
|
-
],
|
|
79
|
-
"@wm/mobile/offline": [
|
|
80
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/offline"
|
|
81
|
-
],
|
|
82
|
-
"@wm/mobile/variables": [
|
|
83
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/variables"
|
|
84
|
-
],
|
|
85
70
|
"@wm/runtime/base": [
|
|
86
71
|
"node_modules/@wavemaker/app-ng-runtime/runtime/base"
|
|
87
72
|
],
|
|
88
73
|
"@wm/runtime/dynamic": [
|
|
89
74
|
"node_modules/@wavemaker/app-ng-runtime/runtime/dynamic"
|
|
90
|
-
],
|
|
91
|
-
"@wm/mobile/runtime": [
|
|
92
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/placeholder/runtime"
|
|
93
|
-
],
|
|
94
|
-
"@wm/mobile/runtime-dynamic": [
|
|
95
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/placeholder/runtime/dynamic"
|
|
96
75
|
]
|
|
97
76
|
}
|
|
98
77
|
},
|