@wavemaker/angular-app 11.10.5-rc.6100 → 11.11.0-rc.209

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-app",
3
- "version": "11.10.5-rc.6100",
3
+ "version": "11.11.0-rc.209",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "./node_modules/.bin/ng serve",
@@ -30,35 +30,24 @@
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
- "@awesome-cordova-plugins/app-version": "5.39.1",
34
- "@awesome-cordova-plugins/barcode-scanner": "5.39.1",
35
- "@awesome-cordova-plugins/calendar": "5.39.1",
36
- "@awesome-cordova-plugins/camera": "5.39.1",
37
- "@awesome-cordova-plugins/core": "5.39.1",
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
33
  "@babel/runtime": "7.14.8",
34
+ "@fullcalendar/core": "6.1.15",
35
+ "@fullcalendar/daygrid": "6.1.15",
36
+ "@fullcalendar/interaction": "6.1.15",
37
+ "@fullcalendar/list": "6.1.15",
38
+ "@fullcalendar/timegrid": "6.1.15",
49
39
  "@metrichor/jmespath": "0.3.1",
50
- "@wavemaker/custom-widgets-m3": "11.10.5-rc.6100",
40
+ "@wavemaker/custom-widgets-m3": "11.11.0-rc.209",
51
41
  "@wavemaker/focus-trap": "1.0.1",
52
- "@wavemaker/foundation-css": "11.10.5-rc.6100",
42
+ "@wavemaker/foundation-css": "11.11.0-rc.209",
53
43
  "@wavemaker/nvd3": "1.8.12",
54
- "@wavemaker/variables": "11.10.5-rc.6100",
44
+ "@wavemaker/variables": "11.11.0-rc.209",
55
45
  "@ztree/ztree_v3": "3.5.48",
56
46
  "angular-imask": "^7.6.1",
57
47
  "angular2-websocket": "0.9.7",
58
48
  "core-js": "3.35.1",
59
49
  "d3": "7.8.5",
60
50
  "esbuild-wasm": "^0.24.2",
61
- "fullcalendar": "5.3.1",
62
51
  "hammerjs": "2.0.8",
63
52
  "iscroll": "5.2.0",
64
53
  "jquery": "3.7.1",
@@ -78,7 +67,7 @@
78
67
  "tslib": "2.4.1",
79
68
  "x2js": "3.4.4",
80
69
  "zone.js": "0.14.10",
81
- "@wavemaker/app-ng-runtime": "11.10.5-rc.6100"
70
+ "@wavemaker/app-ng-runtime": "11.11.0-rc.209"
82
71
  },
83
72
  "devDependencies": {
84
73
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
@@ -120,6 +109,7 @@
120
109
  "jest-preset-angular": "^14.1.0",
121
110
  "license-checker": "25.0.1",
122
111
  "moment": "2.29.4",
112
+ "moment-locales-webpack-plugin": "^1.2.0",
123
113
  "moment-timezone": "^0.5.34",
124
114
  "ng-packagr": "17.3.0",
125
115
  "npm-run-all": "4.1.5",
@@ -1,5 +1,6 @@
1
1
  import { Injectable } from '@angular/core';
2
- import { isMobileApp, ScriptLoaderService } from '@wm/core';
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
  }
package/src/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  <link rel="icon" type="image/x-icon" href="favicon.ico">
12
12
 
13
13
  </head>
14
- <body class="wm-app">
14
+ <body class="wm-app">
15
15
  <app-root></app-root>
16
16
  </body>
17
17
  </html>
package/src/main.ts CHANGED
@@ -1,20 +1,19 @@
1
- import { ApplicationRef, enableProdMode, NgModuleRef } from '@angular/core';
2
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
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
- let formatAcceptHeader = (languages: any) => {
13
- let result: string[] = [];
14
- let addedLanguages = new Set<string>(); // To track already added languages
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: any) => {
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,26 @@ 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
- (window as any)._WM_APP_PROPERTIES = WMAppProperties
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
- enableProdMode();
48
+ enableProdMode();
50
49
  }
51
50
 
52
51
  document.addEventListener('DOMContentLoaded', () => {
53
- new Promise<Event | void>( resolve => {
54
- if (window['cordova']) {
55
- document.addEventListener('deviceready', resolve);
56
- } else {
57
- resolve();
58
- }
59
- }).then(() => platformBrowserDynamic().bootstrapModule(AppModule))
60
- .then((appModuleRef: NgModuleRef<AppModule>) => {
61
- const applicationRef = appModuleRef.injector.get(ApplicationRef);
62
- window.addEventListener('unload', () => {
63
- applicationRef.components.map(c => c && c.destroy());
64
- });
65
- //console.timeEnd('bootstrap'), err => console.log(err);
66
- }, err => console.log(err));
67
- });
52
+ new Promise<Event | void>(resolve => {
53
+ resolve();
54
+ }).then(() => bootstrapApplication(AppComponent, appConfig))
55
+ .then((appRef: ApplicationRef) => {
56
+ window.addEventListener('unload', () => {
57
+ appRef.components.map(c => c?.destroy());
58
+ });
59
+ })
60
+ .catch(err => console.error('Error bootstrapping app:', err));
61
+ });
package/tsconfig.json CHANGED
@@ -32,9 +32,6 @@
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
  ],
@@ -56,18 +53,9 @@
56
53
  "@wm/components/page": [
57
54
  "node_modules/@wavemaker/app-ng-runtime/components/page/default"
58
55
  ],
59
- "@wm/mobile/components/basic": [
60
- "node_modules/@wavemaker/app-ng-runtime/mobile/components/basic/default"
61
- ],
62
- "@wm/mobile/components/page": [
63
- "node_modules/@wavemaker/app-ng-runtime/mobile/components/page/default"
64
- ],
65
56
  "@wm/components/dialogs": [
66
57
  "node_modules/@wavemaker/app-ng-runtime/components/dialogs/default"
67
58
  ],
68
- "@wm/mobile/components/*": [
69
- "node_modules/@wavemaker/app-ng-runtime/mobile/components/*"
70
- ],
71
59
  "@wm/components/*": [
72
60
  "node_modules/@wavemaker/app-ng-runtime/components/*"
73
61
  ],
@@ -89,29 +77,11 @@
89
77
  "@wm/variables": [
90
78
  "node_modules/@wavemaker/app-ng-runtime/variables"
91
79
  ],
92
- "@wm/mobile/core": [
93
- "node_modules/@wavemaker/app-ng-runtime/mobile/core"
94
- ],
95
- "@wm/mobile/components": [
96
- "node_modules/@wavemaker/app-ng-runtime/mobile/components"
97
- ],
98
- "@wm/mobile/offline": [
99
- "node_modules/@wavemaker/app-ng-runtime/mobile/offline"
100
- ],
101
- "@wm/mobile/variables": [
102
- "node_modules/@wavemaker/app-ng-runtime/mobile/variables"
103
- ],
104
80
  "@wm/runtime/base": [
105
81
  "node_modules/@wavemaker/app-ng-runtime/runtime/base"
106
82
  ],
107
83
  "@wm/runtime/dynamic": [
108
84
  "node_modules/@wavemaker/app-ng-runtime/runtime/dynamic"
109
- ],
110
- "@wm/mobile/runtime": [
111
- "node_modules/@wavemaker/app-ng-runtime/mobile/runtime"
112
- ],
113
- "@wm/mobile/runtime/dynamic": [
114
- "node_modules/@wavemaker/app-ng-runtime/mobile/runtime-dynamic"
115
85
  ]
116
86
  },
117
87
  "useDefineForClassFields": false
@@ -31,9 +31,6 @@
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
  ],
@@ -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
  },
@@ -2,6 +2,18 @@ const CompressionPlugin = require(`compression-webpack-plugin`);
2
2
  const path = require(`path`);
3
3
  const {ConcatSource} = require("webpack-sources");
4
4
 
5
+ const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
6
+
7
+ const wmPropertiesPath = path.join(__dirname, '/src/app/wmProperties.js');
8
+
9
+ const { WMAppProperties } = require(wmPropertiesPath);
10
+
11
+ const localesToKeep = Object.values(WMAppProperties.supportedLanguages)
12
+ .map(lang => lang.moment)
13
+ .filter(locale => locale !== null);
14
+
15
+ const includeMomentPlugin = WMAppProperties.languageBundleSources === "STATIC";
16
+
5
17
  class ModifyCssAssetUrlsPlugin {
6
18
  apply(compiler) {
7
19
  compiler.hooks.compilation.tap('ModifyCssAssetUrlsPlugin', compilation => {
@@ -78,6 +90,12 @@ module.exports = {
78
90
  filename: "[name].br[ext]",
79
91
  algorithm: "brotliCompress"
80
92
  }),
93
+ // On STATIC WMAppProperties.languageBundleSources, required moment locales are included in the bundle
94
+
95
+ /**
96
+ * MomentLocalesPlugin is used to include only the required moment locales in the bundle.
97
+ */
98
+ ...(includeMomentPlugin ? [ new MomentLocalesPlugin({ localesToKeep }) ] : [])
81
99
  ],
82
100
  optimization: {
83
101
  splitChunks: {