@wavemaker/angular-app 11.7.5-1.5782
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/.npmrc +1 -0
- package/angular.json +269 -0
- package/build-scripts/build.js +35 -0
- package/build-scripts/index-html-transform.js +28 -0
- package/build-scripts/optimize-css.gulpfile.js +101 -0
- package/build-scripts/post-build.js +311 -0
- package/dependencies/app.component.html +28 -0
- package/dependencies/expression-parser.cjs.js +50533 -0
- package/dependencies/pipe-provider.cjs.js +206320 -0
- package/dependencies/transpilation-mobile.cjs.js +93287 -0
- package/dependencies/transpilation-web.cjs.js +104478 -0
- package/package-lock.json +25051 -0
- package/package.json +132 -0
- package/pwa-assets/icons/icon-128x128.png +0 -0
- package/pwa-assets/icons/icon-144x144.png +0 -0
- package/pwa-assets/icons/icon-152x152.png +0 -0
- package/pwa-assets/icons/icon-192x192.png +0 -0
- package/pwa-assets/icons/icon-384x384.png +0 -0
- package/pwa-assets/icons/icon-512x512.png +0 -0
- package/pwa-assets/icons/icon-72x72.png +0 -0
- package/pwa-assets/icons/icon-96x96.png +0 -0
- package/pwa-assets/manifest.json +59 -0
- package/pwa-assets/ngsw-config.json +30 -0
- package/pwa-assets/wmsw-worker.js +24 -0
- package/src/.browserslistrc +12 -0
- package/src/app/app-codegen.module.ts +11 -0
- package/src/app/app.component.css +0 -0
- package/src/app/app.component.script.js +3 -0
- package/src/app/app.component.variables.ts +3 -0
- package/src/app/app.routes.ts +5 -0
- package/src/app/lazy-load-scripts.resolve.ts +20 -0
- package/src/app/prefabs/prefab-config.js +2 -0
- package/src/app/wm-project-properties.ts +3 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/print.css +32 -0
- package/src/environments/environment.dev.ts +3 -0
- package/src/environments/environment.prod.ts +3 -0
- package/src/environments/environment.ts +16 -0
- package/src/framework/angular1.polyfills.ts +36 -0
- package/src/framework/services/app-extension.service.ts +20 -0
- package/src/framework/services/app-js-provider.service.ts +15 -0
- package/src/framework/services/app-variables-provider.service.ts +15 -0
- package/src/framework/services/component-ref-provider.service.ts +40 -0
- package/src/framework/services/lazy-component-ref-provider.service.ts +64 -0
- package/src/framework/services/prefab-config-provider.service.ts +13 -0
- package/src/framework/util/lazy-module-routes.ts +4 -0
- package/src/framework/util/page-util.ts +5 -0
- package/src/index.html +17 -0
- package/src/main.ts +30 -0
- package/src/polyfills.ts +53 -0
- package/src/setup-jest.js +120 -0
- package/src/styles.css +1 -0
- package/src/tsconfig.app.json +14 -0
- package/src/tslint.json +17 -0
- package/tsconfig.json +131 -0
- package/tsconfig.web-app.json +102 -0
- package/wm-custom-webpack.config.js +94 -0
package/package.json
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wavemaker/angular-app",
|
|
3
|
+
"version": "11.7.5-1.5782",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "./node_modules/.bin/ng serve",
|
|
7
|
+
"build": "node build-scripts/build.js",
|
|
8
|
+
"post-build": "node build-scripts/post-build.js",
|
|
9
|
+
"test": "jest --no-cache",
|
|
10
|
+
"test:watch": "jest --watch",
|
|
11
|
+
"test:coverage": "jest --coverage",
|
|
12
|
+
"test-prod": "jest --no-cache --no-color --ci --silent 2>&1 | sed 's/\\x1b\\[[0-9;]*m//g' > karma-test-report.txt",
|
|
13
|
+
"lint": "./node_modules/.bin/ng lint",
|
|
14
|
+
"e2e": "./node_modules/.bin/ng e2e",
|
|
15
|
+
"optimizecss": "gulp --gulpfile build-scripts/optimize-css.gulpfile.js",
|
|
16
|
+
"owasp": "owasp-dependency-check --project \"wavemaker-ng-runtime\" -f \"ALL\""
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"**/*",
|
|
20
|
+
".npmrc"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@angular/animations": "17.3.11",
|
|
24
|
+
"@angular/common": "17.3.11",
|
|
25
|
+
"@angular/compiler": "17.3.11",
|
|
26
|
+
"@angular/core": "17.3.11",
|
|
27
|
+
"@angular/forms": "17.3.11",
|
|
28
|
+
"@angular/platform-browser": "17.3.11",
|
|
29
|
+
"@angular/platform-browser-dynamic": "17.3.11",
|
|
30
|
+
"@angular/router": "17.3.11",
|
|
31
|
+
"@angular/service-worker": "17.3.11",
|
|
32
|
+
"@awesome-cordova-plugins/app-version": "5.39.1",
|
|
33
|
+
"@awesome-cordova-plugins/barcode-scanner": "5.39.1",
|
|
34
|
+
"@awesome-cordova-plugins/calendar": "5.39.1",
|
|
35
|
+
"@awesome-cordova-plugins/camera": "5.39.1",
|
|
36
|
+
"@awesome-cordova-plugins/core": "5.39.1",
|
|
37
|
+
"@awesome-cordova-plugins/device": "5.39.1",
|
|
38
|
+
"@awesome-cordova-plugins/diagnostic": "5.39.1",
|
|
39
|
+
"@awesome-cordova-plugins/file": "5.39.1",
|
|
40
|
+
"@awesome-cordova-plugins/file-opener": "5.39.1",
|
|
41
|
+
"@awesome-cordova-plugins/geolocation": "5.39.1",
|
|
42
|
+
"@awesome-cordova-plugins/location-accuracy": "5.39.1",
|
|
43
|
+
"@awesome-cordova-plugins/media-capture": "5.39.1",
|
|
44
|
+
"@awesome-cordova-plugins/network": "5.39.1",
|
|
45
|
+
"@awesome-cordova-plugins/sqlite": "5.39.1",
|
|
46
|
+
"@awesome-cordova-plugins/vibration": "5.39.1",
|
|
47
|
+
"@babel/runtime": "7.14.8",
|
|
48
|
+
"@metrichor/jmespath": "0.3.1",
|
|
49
|
+
"@wavemaker/focus-trap": "1.0.1",
|
|
50
|
+
"@wavemaker/nvd3": "1.8.11",
|
|
51
|
+
"@wavemaker/variables": "11.7.5-1.5782",
|
|
52
|
+
"@ztree/ztree_v3": "3.5.48",
|
|
53
|
+
"angular-imask": "^7.6.1",
|
|
54
|
+
"angular2-websocket": "0.9.7",
|
|
55
|
+
"core-js": "3.35.1",
|
|
56
|
+
"d3": "7.8.5",
|
|
57
|
+
"fullcalendar": "5.3.1",
|
|
58
|
+
"hammerjs": "2.0.8",
|
|
59
|
+
"iscroll": "5.2.0",
|
|
60
|
+
"jquery": "3.7.1",
|
|
61
|
+
"jquery-ui": "1.13.3",
|
|
62
|
+
"js-cookie": "2.2.0",
|
|
63
|
+
"jssha": "3.1.2",
|
|
64
|
+
"lodash-es": "4.17.21",
|
|
65
|
+
"ng-circle-progress": "1.7.1",
|
|
66
|
+
"ngx-bootstrap": "9.0.0",
|
|
67
|
+
"ngx-color-picker": "16.0.0",
|
|
68
|
+
"ngx-toastr": "17.0.2",
|
|
69
|
+
"rxjs": "6.6.0",
|
|
70
|
+
"rxjs-compat": "6.4.0",
|
|
71
|
+
"summernote": "0.8.18",
|
|
72
|
+
"ts-jest": "29.1.1",
|
|
73
|
+
"tslib": "2.4.1",
|
|
74
|
+
"x2js": "3.4.4",
|
|
75
|
+
"zone.js": "0.14.7",
|
|
76
|
+
"@wavemaker/app-ng-runtime": "11.7.5-1.5782"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
|
|
80
|
+
"@angular-builders/custom-webpack": "17.0.2",
|
|
81
|
+
"@angular-devkit/build-angular": "17.3.8",
|
|
82
|
+
"@angular/cli": "17.3.8",
|
|
83
|
+
"@angular/compiler-cli": "17.3.11",
|
|
84
|
+
"@angular/language-service": "17.3.11",
|
|
85
|
+
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
86
|
+
"@compodoc/compodoc": "^1.1.19",
|
|
87
|
+
"@rollup/plugin-alias": "4.0.2",
|
|
88
|
+
"@rollup/plugin-commonjs": "24.0.0",
|
|
89
|
+
"@rollup/plugin-multi-entry": "6.0.0",
|
|
90
|
+
"@rollup/plugin-node-resolve": "15.0.1",
|
|
91
|
+
"@types/jest": "^29.5.12",
|
|
92
|
+
"@types/jquery": "3.3.22",
|
|
93
|
+
"@types/lodash-es": "4.17.12",
|
|
94
|
+
"@types/node": "12.11.1",
|
|
95
|
+
"@types/sizzle": "^2.3.3",
|
|
96
|
+
"babel-loader": "^9.1.2",
|
|
97
|
+
"cheerio": "^1.0.0-rc.12",
|
|
98
|
+
"codelyzer": "5.1.2",
|
|
99
|
+
"compression-webpack-plugin": "10.0.0",
|
|
100
|
+
"core-js-builder": "2.5.7",
|
|
101
|
+
"fs": "0.0.1-security",
|
|
102
|
+
"fs-extra": "7.0.1",
|
|
103
|
+
"jest": "^29.7.0",
|
|
104
|
+
"jest-canvas-mock": "^2.5.2",
|
|
105
|
+
"jest-preset-angular": "^14.1.0",
|
|
106
|
+
"moment": "2.29.4",
|
|
107
|
+
"moment-timezone": "^0.5.34",
|
|
108
|
+
"ng-packagr": "17.3.0",
|
|
109
|
+
"npm-run-all": "4.1.5",
|
|
110
|
+
"owasp-dependency-check": "0.0.21",
|
|
111
|
+
"rimraf": "2.6.3",
|
|
112
|
+
"rollup": "4.9.5",
|
|
113
|
+
"rollup-plugin-includepaths": "0.2.3",
|
|
114
|
+
"sonarqube-scanner": "^2.8.2",
|
|
115
|
+
"terser": "^5.15.1",
|
|
116
|
+
"ts-node": "7.0.1",
|
|
117
|
+
"tslint": "~6.1.0",
|
|
118
|
+
"typescript": "5.4.5",
|
|
119
|
+
"util": "0.11.1",
|
|
120
|
+
"yargs": "^17.3.1"
|
|
121
|
+
},
|
|
122
|
+
"optionalDependencies": {
|
|
123
|
+
"@rollup/rollup-darwin-arm64": "4.9.5",
|
|
124
|
+
"@rollup/rollup-linux-x64-gnu": "4.9.5",
|
|
125
|
+
"@rollup/rollup-win32-x64": "4.9.5"
|
|
126
|
+
},
|
|
127
|
+
"engines": {
|
|
128
|
+
"node": ">=18.16.1",
|
|
129
|
+
"npm": ">=9.5.1"
|
|
130
|
+
},
|
|
131
|
+
"engineStrict": true
|
|
132
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wm-pwa",
|
|
3
|
+
"short_name": "wm-pwa",
|
|
4
|
+
"theme_color": "#2c3049",
|
|
5
|
+
"background_color": "#fafafa",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"scope": "./",
|
|
8
|
+
"start_url": "./",
|
|
9
|
+
"icons": [
|
|
10
|
+
{
|
|
11
|
+
"src": "./ng-bundle/assets/icons/icon-72x72.png",
|
|
12
|
+
"sizes": "72x72",
|
|
13
|
+
"type": "image/png",
|
|
14
|
+
"purpose": "maskable any"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"src": "./ng-bundle/assets/icons/icon-96x96.png",
|
|
18
|
+
"sizes": "96x96",
|
|
19
|
+
"type": "image/png",
|
|
20
|
+
"purpose": "maskable any"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"src": "./ng-bundle/assets/icons/icon-128x128.png",
|
|
24
|
+
"sizes": "128x128",
|
|
25
|
+
"type": "image/png",
|
|
26
|
+
"purpose": "maskable any"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"src": "./ng-bundle/assets/icons/icon-144x144.png",
|
|
30
|
+
"sizes": "144x144",
|
|
31
|
+
"type": "image/png",
|
|
32
|
+
"purpose": "maskable any"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"src": "./ng-bundle/assets/icons/icon-152x152.png",
|
|
36
|
+
"sizes": "152x152",
|
|
37
|
+
"type": "image/png",
|
|
38
|
+
"purpose": "maskable any"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"src": "./ng-bundle/assets/icons/icon-192x192.png",
|
|
42
|
+
"sizes": "192x192",
|
|
43
|
+
"type": "image/png",
|
|
44
|
+
"purpose": "maskable any"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"src": "./ng-bundle/assets/icons/icon-384x384.png",
|
|
48
|
+
"sizes": "384x384",
|
|
49
|
+
"type": "image/png",
|
|
50
|
+
"purpose": "maskable any"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"src": "./ng-bundle/assets/icons/icon-512x512.png",
|
|
54
|
+
"sizes": "512x512",
|
|
55
|
+
"type": "image/png",
|
|
56
|
+
"purpose": "maskable any"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"index": "/index.html",
|
|
3
|
+
"assetGroups": [
|
|
4
|
+
{
|
|
5
|
+
"name": "app",
|
|
6
|
+
"installMode": "prefetch",
|
|
7
|
+
"resources": {
|
|
8
|
+
"files": [
|
|
9
|
+
"/favicon.ico",
|
|
10
|
+
"/index.html",
|
|
11
|
+
"/manifest.json",
|
|
12
|
+
"/*.css",
|
|
13
|
+
"/*.js"
|
|
14
|
+
],
|
|
15
|
+
"urls": []
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "assets",
|
|
20
|
+
"installMode": "lazy",
|
|
21
|
+
"resources": {
|
|
22
|
+
"files": [
|
|
23
|
+
"/assets/**",
|
|
24
|
+
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
|
|
25
|
+
],
|
|
26
|
+
"urls": []
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
importScripts("./ngsw-worker.js");
|
|
2
|
+
|
|
3
|
+
(function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
self.addEventListener("notificationclick", (event) => {
|
|
7
|
+
const notificationUrl = event.notification.data?.url;
|
|
8
|
+
event.notification.close();
|
|
9
|
+
// Enumerate windows, and call window.focus(), or open a new one.
|
|
10
|
+
event.waitUntil(
|
|
11
|
+
clients.matchAll().then((matchedClients) => {
|
|
12
|
+
for (let client of matchedClients) {
|
|
13
|
+
if (!notificationUrl) {
|
|
14
|
+
return client.focus();
|
|
15
|
+
}
|
|
16
|
+
if (client.url === notificationUrl) {
|
|
17
|
+
return client.focus();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return clients.openWindow(notificationUrl);
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
})();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
|
|
2
|
+
# For additional information regarding the format and rule options, please see:
|
|
3
|
+
# https://github.com/browserslist/browserslist#queries
|
|
4
|
+
#
|
|
5
|
+
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
|
|
6
|
+
|
|
7
|
+
> 0.5%
|
|
8
|
+
last 2 versions
|
|
9
|
+
Firefox ESR
|
|
10
|
+
not dead
|
|
11
|
+
not IE 9-10
|
|
12
|
+
not IE 11
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { isMobileApp, ScriptLoaderService } from '@wm/core';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class LazyLoadScriptsResolve {
|
|
7
|
+
|
|
8
|
+
constructor(private scriptLoaderService: ScriptLoaderService) {}
|
|
9
|
+
|
|
10
|
+
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
|
+
}
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
body {margin:0; padding:0; line-height: 1.4em; word-spacing:1px; letter-spacing:0.2px; font: 13px Arial, Helvetica,"Lucida Grande", serif; color: #000;}
|
|
2
|
+
|
|
3
|
+
/*Header*/
|
|
4
|
+
h2 {color:#000; font-size:25px;}
|
|
5
|
+
|
|
6
|
+
/* Links */
|
|
7
|
+
a:link, a:visited {background: transparent; color:#333; text-decoration:none;}
|
|
8
|
+
a:link[href^="http://"]:after, a[href^="http://"]:visited:after {content: " (" attr(href) ") "; font-size: 11px;}
|
|
9
|
+
a[href^="http://"] {color:#000;}
|
|
10
|
+
|
|
11
|
+
/*Image*/
|
|
12
|
+
img, img a, .more-link a {border:none;}
|
|
13
|
+
|
|
14
|
+
/*Remove Element*/
|
|
15
|
+
.app-header, .app-top-nav, .app-footer, .app-left-panel, .app-right-panel {display: none !important;}
|
|
16
|
+
|
|
17
|
+
/*Remove Form Controls*/
|
|
18
|
+
.app-checkboxset, .app-button, .app-button-group, .app-menu, .app-composite-widget,
|
|
19
|
+
.form-group, .form-control,
|
|
20
|
+
.app-fileupload, .app-grid .table-footer
|
|
21
|
+
{display: none !important;}
|
|
22
|
+
|
|
23
|
+
/*Show all of the grid data*/
|
|
24
|
+
.app-grid .app-datagrid .app-datagrid-cell {
|
|
25
|
+
overflow: visible;
|
|
26
|
+
word-wrap: break-word;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/*Show Grid record data*/
|
|
30
|
+
.app-grid-layout .form-group {
|
|
31
|
+
display: block !important;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
+
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
+
// The list of file replacements can be found in `angular.json`.
|
|
4
|
+
|
|
5
|
+
export const environment = {
|
|
6
|
+
production: false
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* For easier debugging in development mode, you can import the following file
|
|
11
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
12
|
+
*
|
|
13
|
+
* This import should be commented out in production mode because it will have a negative impact
|
|
14
|
+
* on performance if an error is thrown.
|
|
15
|
+
*/
|
|
16
|
+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const win = window as any;
|
|
2
|
+
|
|
3
|
+
win.Application = win.angular = {};
|
|
4
|
+
|
|
5
|
+
const deprecatedAngularJSFeature = (feature) => {
|
|
6
|
+
return () => {
|
|
7
|
+
console.warn(`DEPRECATED AngularJS 1.x feature: ${feature}`);
|
|
8
|
+
return win.angular;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
[
|
|
13
|
+
'module',
|
|
14
|
+
'controller',
|
|
15
|
+
'directive',
|
|
16
|
+
'run',
|
|
17
|
+
'config',
|
|
18
|
+
'service',
|
|
19
|
+
'factory',
|
|
20
|
+
'constant',
|
|
21
|
+
'value',
|
|
22
|
+
'animation',
|
|
23
|
+
'component',
|
|
24
|
+
'decorator',
|
|
25
|
+
'filter',
|
|
26
|
+
'info',
|
|
27
|
+
'provider',
|
|
28
|
+
'requires',
|
|
29
|
+
'$watch'
|
|
30
|
+
].forEach(feature => {
|
|
31
|
+
win.angular[feature] = deprecatedAngularJSFeature(feature);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export const patchAngular1Deprecations = () => {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { AppExtensionProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
declare const WM_CUSTOM_FORMATTERS;
|
|
6
|
+
@Injectable({
|
|
7
|
+
providedIn: 'root'
|
|
8
|
+
})
|
|
9
|
+
export class AppExtensionProviderService extends AppExtensionProvider {
|
|
10
|
+
|
|
11
|
+
public loadFormatterConfigScript(callback:Function):void {
|
|
12
|
+
try{
|
|
13
|
+
callback(WM_CUSTOM_FORMATTERS);
|
|
14
|
+
|
|
15
|
+
}catch(e){
|
|
16
|
+
console.warn('Error while loading the formatters.js file');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { AppJSProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
import { initScript } from '../../app/app.component.script';
|
|
6
|
+
|
|
7
|
+
@Injectable({
|
|
8
|
+
providedIn: 'root'
|
|
9
|
+
})
|
|
10
|
+
export class AppJSProviderService extends AppJSProvider {
|
|
11
|
+
|
|
12
|
+
public getAppScriptFn(): Promise<Function> {
|
|
13
|
+
return Promise.resolve(initScript);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { AppVariablesProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
import { variables } from '../../app/app.component.variables';
|
|
6
|
+
|
|
7
|
+
@Injectable({
|
|
8
|
+
providedIn: 'root'
|
|
9
|
+
})
|
|
10
|
+
export class AppVariablesProviderService extends AppVariablesProvider {
|
|
11
|
+
|
|
12
|
+
public async getAppVariables(): Promise<any> {
|
|
13
|
+
return Promise.resolve(variables);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentFactoryResolver, Injectable, Inject } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { ComponentRefProvider, ComponentType } from '@wm/runtime/base';
|
|
4
|
+
import { LazyComponentRefProviderService } from './lazy-component-ref-provider.service';
|
|
5
|
+
|
|
6
|
+
const componentRefCache = new Map<ComponentType, Map<string, any>>();
|
|
7
|
+
|
|
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>());
|
|
11
|
+
|
|
12
|
+
@Injectable()
|
|
13
|
+
export class ComponentRefProviderService extends ComponentRefProvider {
|
|
14
|
+
|
|
15
|
+
static registerComponentRef(name: string, type: ComponentType, ref: any, componentFactory?: any) {
|
|
16
|
+
componentRefCache.get(type).set(name, {ref: ref, componentFactory: componentFactory});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
constructor(private componentFactoryResolver: ComponentFactoryResolver, @Inject(LazyComponentRefProviderService) private lazyComponentRef) {
|
|
20
|
+
super();
|
|
21
|
+
}
|
|
22
|
+
|
|
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(
|
|
27
|
+
componentName,
|
|
28
|
+
componentType,
|
|
29
|
+
options
|
|
30
|
+
);
|
|
31
|
+
if (partialRef) {
|
|
32
|
+
return Promise.resolve(partialRef);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!value.componentFactory) {
|
|
36
|
+
value.componentFactory = this.componentFactoryResolver.resolveComponentFactory(value.ref);
|
|
37
|
+
}
|
|
38
|
+
return Promise.resolve(value.componentFactory);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Injectable,
|
|
3
|
+
NgModuleRef,
|
|
4
|
+
Type,
|
|
5
|
+
Injector,
|
|
6
|
+
Compiler,
|
|
7
|
+
NgModuleFactory,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { PartialRefProvider } from '@wm/core';
|
|
10
|
+
import { ComponentType } from '@wm/runtime/base';
|
|
11
|
+
import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
|
|
12
|
+
|
|
13
|
+
type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
|
|
14
|
+
type Options = {
|
|
15
|
+
prefab: string
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
@Injectable({
|
|
19
|
+
providedIn: 'root'
|
|
20
|
+
})
|
|
21
|
+
export class LazyComponentRefProviderService extends PartialRefProvider {
|
|
22
|
+
private moduleRef: NgModuleRef<any>;
|
|
23
|
+
|
|
24
|
+
constructor(private injector: Injector, private compiler: Compiler) {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
|
|
29
|
+
if (componentType === ComponentType.PARTIAL && options && options.prefab) {
|
|
30
|
+
return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
|
|
31
|
+
}
|
|
32
|
+
if (componentType === ComponentType.PARTIAL) {
|
|
33
|
+
return partialLazyModules[componentName];
|
|
34
|
+
}
|
|
35
|
+
if (componentType === ComponentType.PREFAB) {
|
|
36
|
+
return prefabLazyModules[componentName];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
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
|
+
public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
|
|
49
|
+
try {
|
|
50
|
+
const moduleOrFactory = await this.getLazyModule(componentName, componentType, options).loadChildren();
|
|
51
|
+
const moduleFactory = await this.getModuleFactory(moduleOrFactory);
|
|
52
|
+
|
|
53
|
+
this.moduleRef = moduleFactory.create(this.injector);
|
|
54
|
+
const rootComponent = (moduleFactory.moduleType as ModuleWithRoot)
|
|
55
|
+
.rootComponent;
|
|
56
|
+
return this.moduleRef.componentFactoryResolver.resolveComponentFactory(
|
|
57
|
+
rootComponent
|
|
58
|
+
);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error(e);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { PrefabConfigProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
import { getPrefabConfig } from '../util/page-util';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class PrefabConfigProviderService extends PrefabConfigProvider {
|
|
9
|
+
|
|
10
|
+
public getConfig(prefabName: string): Promise<any> {
|
|
11
|
+
return Promise.resolve(getPrefabConfig(prefabName));
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/index.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Runtime Angular App</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<link rel="stylesheet" href="//localhost:8080/wavemaker/_static_/9.9.9/wmapp/styles/css/wm-style.css">
|
|
10
|
+
<link rel="stylesheet" href="//localhost:8080/b/themes/material/style.css">
|
|
11
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
12
|
+
|
|
13
|
+
</head>
|
|
14
|
+
<body class="wm-app">
|
|
15
|
+
<app-root></app-root>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|