@wavemaker/app-ng-runtime 11.11.0-rc.6112 → 11.11.0-rc.6113

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,41 +1,28 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Injectable, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, ViewEncapsulation, Inject, Injector, importProvidersFrom, APP_INITIALIZER, LOCALE_ID, enableProdMode } from '@angular/core';
3
- import { isUndefined, isString, isEmpty } from 'lodash-es';
4
- import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
5
- import * as i4 from '@wm/runtime/base';
6
- import { ComponentType, BasePageComponent, SecurityConfigResolve, MetadataResolve, AppExtensionJSResolve, EmptyPageComponent, PrefabPreviewComponent, CanDeactivatePageGuard, CustomwidgetConfigProvider, AppJSProvider, AppVariablesProvider, AppExtensionProvider, getPrefabPartialJsonUrl, getPrefabMinJsonUrl, RuntimeBaseModule, BaseCustomWidgetComponent, BasePrefabComponent, BasePartialComponent, ComponentRefProvider, PrefabConfigProvider, getPrefabConfigUrl, AppJSResolve, HttpCallInterceptor, AppRef, ToasterServiceImpl, I18nServiceImpl, SpinnerServiceImpl, NavigationServiceImpl, AppDefaultsService, DynamicComponentRefProviderService, WmRouteReuseStrategy, PipeService, AppManagerService, PrefabManagerService, AuthGuard, RoleGuard, PageNotFoundGuard, I18nResolve, AppComponent, REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS, WM_MODULES_FOR_ROOT } from '@wm/runtime/base';
2
+ import { Component, Injectable, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, ViewEncapsulation, Inject, Injector, enableProdMode, ApplicationRef } from '@angular/core';
3
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4
+ import { __decorate, __param, __metadata } from 'tslib';
5
+ import { BrowserModule } from '@angular/platform-browser';
6
+ import { CommonModule } from '@angular/common';
7
7
  import * as i1 from '@angular/router';
8
- import { provideRouter, withHashLocation, withComponentInputBinding, RouteReuseStrategy, RouterModule } from '@angular/router';
8
+ import { RouterModule, RouteReuseStrategy } from '@angular/router';
9
9
  import * as i1$1 from '@angular/common/http';
10
- import { provideHttpClient, withInterceptorsFromDi, withXsrfConfiguration, HTTP_INTERCEPTORS, HttpClientXsrfModule, HttpClientModule } from '@angular/common/http';
11
- import { provideAnimations, BrowserAnimationsModule } from '@angular/platform-browser/animations';
12
- import { WmComponentsModule, DialogServiceImpl, SanitizePipe, ToDatePipe, FilterPipe, TrailingZeroDecimalPipe, TrustAsPipe, ImagePipe, CustomPipe } from '@wm/components/base';
13
- import * as i5 from '@wm/core';
14
- import { appendScriptToHead, UserDefinedExecutionContext, getValidJSON, _WM_APP_PROJECT, AbstractI18nService, App, AbstractToasterService, AbstractSpinnerService, AbstractNavigationService, AbstractDialogService, AppDefaults, DynamicComponentRefProvider, PartialRefProvider, CustomWidgetRefProvider, AbstractHttpService, getWmProjectProperties } from '@wm/core';
15
- import * as i2 from '@wm/variables';
16
- import { VariablesService, MetadataService } from '@wm/variables';
17
- import * as i3 from '@wm/security';
18
- import { SecurityService } from '@wm/security';
19
- import { HttpServiceImpl } from '@wm/http';
20
- import { OAuthService } from '@wm/oAuth';
21
- import { ModalModule } from 'ngx-bootstrap/modal';
22
- import { ToastNoAnimationModule } from 'ngx-toastr';
23
- import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
24
- import { NgCircleProgressModule } from 'ng-circle-progress';
25
- import { DecimalPipe, DatePipe, CommonModule } from '@angular/common';
26
- import { __decorate, __param, __metadata } from 'tslib';
27
- import { transpile, scopeComponentStyles } from '@wm/transpiler';
28
- import * as customWidgets from '@wavemaker/custom-widgets-m3';
29
- import { PageDirective, LayoutDirective, ContentComponent, PageContentComponent, SpaPageDirective, RouterOutletDirective } from '@wm/components/page';
10
+ import { HttpClientXsrfModule, HttpClientModule } from '@angular/common/http';
30
11
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
31
12
  import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
32
13
  import { TimepickerModule } from 'ngx-bootstrap/timepicker';
33
14
  import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
34
15
  import { PaginationModule } from 'ngx-bootstrap/pagination';
16
+ import { ModalModule } from 'ngx-bootstrap/modal';
35
17
  import { TooltipModule } from 'ngx-bootstrap/tooltip';
18
+ import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
36
19
  import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
37
20
  import { PopoverModule } from 'ngx-bootstrap/popover';
21
+ import { NgCircleProgressModule } from 'ng-circle-progress';
22
+ import { ToastNoAnimationModule } from 'ngx-toastr';
38
23
  import { CarouselModule } from 'ngx-bootstrap/carousel';
24
+ import * as i5 from '@wm/core';
25
+ import { appendScriptToHead, UserDefinedExecutionContext, getValidJSON, getWmProjectProperties, PartialRefProvider, CustomWidgetRefProvider, AbstractHttpService, App } from '@wm/core';
39
26
  import { AnchorComponent, AudioComponent, HtmlDirective, IconComponent, IframeComponent, LabelDirective, PictureDirective, SpinnerComponent, VideoComponent } from '@wm/components/basic';
40
27
  import { ProgressBarComponent, ProgressCircleComponent } from '@wm/components/basic/progress';
41
28
  import { RichTextEditorComponent } from '@wm/components/basic/rich-text-editor';
@@ -76,12 +63,23 @@ import { CarouselDirective, CarouselTemplateDirective } from '@wm/components/adv
76
63
  import { LoginComponent } from '@wm/components/advanced/login';
77
64
  import { MarqueeDirective } from '@wm/components/advanced/marquee';
78
65
  import { CustomWidgetDirective, CustomWidgetContainerDirective } from '@wm/components/advanced/custom';
66
+ import { PageDirective, LayoutDirective, ContentComponent, PageContentComponent, SpaPageDirective, RouterOutletDirective } from '@wm/components/page';
79
67
  import { FooterDirective } from '@wm/components/page/footer';
80
68
  import { HeaderComponent } from '@wm/components/page/header';
81
69
  import { LeftPanelDirective } from '@wm/components/page/left-panel';
82
70
  import { RightPanelDirective } from '@wm/components/page/right-panel';
83
71
  import { TopNavDirective } from '@wm/components/page/top-nav';
84
72
  import { PrefabDirective, PrefabContainerDirective } from '@wm/components/prefab';
73
+ import * as i4 from '@wm/runtime/base';
74
+ import { ComponentType, BasePageComponent, SecurityConfigResolve, MetadataResolve, AppExtensionJSResolve, EmptyPageComponent, PrefabPreviewComponent, CanDeactivatePageGuard, AppJSProvider, AppVariablesProvider, AppExtensionProvider, getPrefabPartialJsonUrl, getPrefabMinJsonUrl, RuntimeBaseModule, BaseCustomWidgetComponent, BasePrefabComponent, BasePartialComponent, ComponentRefProvider, CustomwidgetConfigProvider, PrefabConfigProvider, getPrefabConfigUrl, REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS, WM_MODULES_FOR_ROOT, WmRouteReuseStrategy, AppComponent } from '@wm/runtime/base';
75
+ import { WmComponentsModule } from '@wm/components/base';
76
+ import * as i2 from '@wm/variables';
77
+ import * as i3 from '@wm/security';
78
+ import { transpile, scopeComponentStyles } from '@wm/transpiler';
79
+ import { isUndefined, isString, isEmpty } from 'lodash-es';
80
+ import * as customWidgets from '@wavemaker/custom-widgets-m3';
81
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
82
+ import { HttpServiceImpl } from '@wm/http';
85
83
 
86
84
  class PageWrapperComponent {
87
85
  constructor(injector, route, vcRef, appRef, metadataService, securityService, appManager, app, ngZone, elRef, spinnerService, componentRefProvider, router) {
@@ -203,25 +201,6 @@ const routes = [
203
201
  }
204
202
  ];
205
203
 
206
- const cache$2 = new Map();
207
- class CustomwidgetConfigProviderService extends CustomwidgetConfigProvider {
208
- constructor() {
209
- super();
210
- }
211
- getConfig(widgetname) {
212
- return new Promise((res, rej) => {
213
- Promise.resolve(window['resourceCache'].get(`./custom-widgets/${widgetname}/page.min.json`)).then((pageInfo) => {
214
- res(pageInfo.config);
215
- });
216
- });
217
- }
218
- static { this.ɵfac = function CustomwidgetConfigProviderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomwidgetConfigProviderService)(); }; }
219
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CustomwidgetConfigProviderService, factory: CustomwidgetConfigProviderService.ɵfac }); }
220
- }
221
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CustomwidgetConfigProviderService, [{
222
- type: Injectable
223
- }], () => [], null); })();
224
-
225
204
  class AppJSProviderService extends AppJSProvider {
226
205
  constructor($http) {
227
206
  super();
@@ -242,22 +221,22 @@ class AppJSProviderService extends AppJSProvider {
242
221
  }]
243
222
  }], () => [{ type: i1$1.HttpClient }], null); })();
244
223
 
245
- const cache$1 = new Map();
224
+ const cache$2 = new Map();
246
225
  class AppResourceManagerService {
247
226
  get(url, useCache) {
248
- const cachedResponse = cache$1.get(url);
227
+ const cachedResponse = cache$2.get(url);
249
228
  if (cachedResponse) {
250
229
  return Promise.resolve(cachedResponse);
251
230
  }
252
231
  return this.$http.get(url).then(response => {
253
232
  if (useCache) {
254
- cache$1.set(url, response);
233
+ cache$2.set(url, response);
255
234
  }
256
235
  return response;
257
236
  });
258
237
  }
259
238
  clearCache() {
260
- cache$1.clear();
239
+ cache$2.clear();
261
240
  }
262
241
  constructor($http) {
263
242
  this.$http = $http;
@@ -424,7 +403,8 @@ const getDynamicComponent = (componentName, type, template, css, script, variabl
424
403
  {
425
404
  provide: UserDefinedExecutionContext,
426
405
  useExisting: DynamicComponent
427
- }
406
+ },
407
+ PageDirective,
428
408
  ]
429
409
  })(DynamicComponent);
430
410
  return component;
@@ -512,6 +492,25 @@ class ComponentRefProviderService extends ComponentRefProvider {
512
492
  type: Injectable
513
493
  }], () => [{ type: AppResourceManagerService }, { type: i5.App }, { type: i4.AppManagerService }, { type: i0.Compiler }], null); })();
514
494
 
495
+ const cache$1 = new Map();
496
+ class CustomwidgetConfigProviderService extends CustomwidgetConfigProvider {
497
+ constructor() {
498
+ super();
499
+ }
500
+ getConfig(widgetname) {
501
+ return new Promise((res, rej) => {
502
+ Promise.resolve(window['resourceCache'].get(`./custom-widgets/${widgetname}/page.min.json`)).then((pageInfo) => {
503
+ res(pageInfo.config);
504
+ });
505
+ });
506
+ }
507
+ static { this.ɵfac = function CustomwidgetConfigProviderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomwidgetConfigProviderService)(); }; }
508
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CustomwidgetConfigProviderService, factory: CustomwidgetConfigProviderService.ɵfac }); }
509
+ }
510
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CustomwidgetConfigProviderService, [{
511
+ type: Injectable
512
+ }], () => [], null); })();
513
+
515
514
  const cache = new Map();
516
515
  class PrefabConfigProviderService extends PrefabConfigProvider {
517
516
  constructor(resourceMngr) {
@@ -536,145 +535,6 @@ class PrefabConfigProviderService extends PrefabConfigProvider {
536
535
  type: Injectable
537
536
  }], () => [{ type: AppResourceManagerService }], null); })();
538
537
 
539
- const wmModules = [
540
- importProvidersFrom(ModalModule.forRoot(), ToastNoAnimationModule.forRoot({ maxOpened: 1, autoDismiss: true }), BsDatepickerModule.forRoot(), NgCircleProgressModule.forRoot())
541
- ];
542
- const xsrfHeaderName$1 = "X-WM-XSRF-TOKEN";
543
- const initializeProjectDetails = () => {
544
- let cdnUrl = document.querySelector('[name="deployUrl"]') && document.querySelector('[name="deployUrl"]').getAttribute('content');
545
- _WM_APP_PROJECT.isPreview = cdnUrl ? false : true;
546
- const apiUrl = document.querySelector('[name="apiUrl"]') && document.querySelector('[name="apiUrl"]').getAttribute('content');
547
- //for preview
548
- if (!cdnUrl) {
549
- cdnUrl = document.querySelector('[name="cdnUrl"]') && document.querySelector('[name="cdnUrl"]').getAttribute('content');
550
- }
551
- _WM_APP_PROJECT.id = location.href.split('/')[3];
552
- // Integration with third party apps like in SSPA/WebComponents, this meta tag with cdnUrl will not be there then default it to ng-bundle/
553
- _WM_APP_PROJECT.apiUrl = apiUrl || './';
554
- _WM_APP_PROJECT.cdnUrl = cdnUrl || 'ng-bundle/';
555
- _WM_APP_PROJECT.ngDest = 'ng-bundle/';
556
- try {
557
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
558
- //@ts-ignore
559
- __webpack_require__.p = __webpack_public_path__ = cdnUrl;
560
- }
561
- catch (e) {
562
- //for app preview there is no webpack. Don't do anything.
563
- }
564
- };
565
- function InitializeApp(I18nService, AppJSResolve) {
566
- return async () => {
567
- initializeProjectDetails();
568
- await AppJSResolve.resolve();
569
- return I18nService.loadDefaultLocale();
570
- };
571
- }
572
- function setAngularLocale(I18nService) {
573
- initializeProjectDetails();
574
- return I18nService.deduceAppLocale();
575
- }
576
- const appConfig = {
577
- providers: [
578
- // Provide Angular core services
579
- provideRouter(routes, withHashLocation(), withComponentInputBinding()),
580
- provideHttpClient(withInterceptorsFromDi(), withXsrfConfiguration({
581
- cookieName: "wm_xsrf_token",
582
- headerName: xsrfHeaderName$1
583
- })),
584
- provideAnimations(),
585
- // Provide application-specific services
586
- {
587
- provide: APP_INITIALIZER,
588
- useFactory: InitializeApp,
589
- deps: [AbstractI18nService, AppJSResolve],
590
- multi: true
591
- },
592
- {
593
- provide: LOCALE_ID,
594
- useFactory: setAngularLocale,
595
- deps: [AbstractI18nService]
596
- },
597
- {
598
- provide: HTTP_INTERCEPTORS,
599
- useClass: HttpCallInterceptor,
600
- multi: true
601
- },
602
- { provide: App, useClass: AppRef },
603
- { provide: AbstractToasterService, useClass: ToasterServiceImpl },
604
- { provide: AbstractI18nService, useClass: I18nServiceImpl },
605
- { provide: AbstractSpinnerService, useClass: SpinnerServiceImpl },
606
- { provide: AbstractNavigationService, useClass: NavigationServiceImpl },
607
- { provide: AbstractDialogService, useClass: DialogServiceImpl },
608
- { provide: AppDefaults, useClass: AppDefaultsService },
609
- { provide: DynamicComponentRefProvider, useClass: DynamicComponentRefProviderService },
610
- { provide: AppJSProvider, useClass: AppJSProviderService },
611
- { provide: AppVariablesProvider, useClass: AppVariablesProviderService },
612
- { provide: AppExtensionProvider, useClass: AppExtensionProviderService },
613
- { provide: ComponentRefProvider, useClass: ComponentRefProviderService },
614
- { provide: PartialRefProvider, useClass: ComponentRefProviderService },
615
- { provide: CustomWidgetRefProvider, useClass: ComponentRefProviderService },
616
- { provide: CustomwidgetConfigProvider, useClass: CustomwidgetConfigProviderService },
617
- { provide: PrefabConfigProvider, useClass: PrefabConfigProviderService },
618
- { provide: RouteReuseStrategy, useClass: WmRouteReuseStrategy },
619
- { provide: AbstractHttpService, useClass: HttpServiceImpl },
620
- AppResourceManagerService,
621
- PipeService,
622
- DecimalPipe,
623
- SanitizePipe,
624
- ToDatePipe,
625
- FilterPipe,
626
- TrailingZeroDecimalPipe,
627
- TrustAsPipe,
628
- ImagePipe,
629
- CustomPipe,
630
- Location,
631
- DatePipe,
632
- AppManagerService,
633
- PrefabManagerService,
634
- AuthGuard,
635
- RoleGuard,
636
- PageNotFoundGuard,
637
- CanDeactivatePageGuard,
638
- AppJSResolve,
639
- AppExtensionJSResolve,
640
- I18nResolve,
641
- SecurityService,
642
- OAuthService,
643
- VariablesService,
644
- MetadataService,
645
- ...wmModules,
646
- PageDirective
647
- ]
648
- };
649
-
650
- const DEBUG_MODE = 'debugMode';
651
- if (sessionStorage.getItem(DEBUG_MODE) !== 'true') {
652
- enableProdMode();
653
- }
654
- console.time('bootstrap');
655
- document.addEventListener('DOMContentLoaded', () => {
656
- new Promise(resolve => {
657
- resolve();
658
- }).then(() => bootstrapApplication(AppComponent, appConfig))
659
- .then((appRef) => {
660
- window.addEventListener('unload', () => {
661
- appRef.components.map(c => c?.destroy());
662
- });
663
- })
664
- .catch(err => console.error('Error bootstrapping app:', err));
665
- });
666
- window.debugMode = function (on) {
667
- if (isEmpty(on)) {
668
- on = true;
669
- }
670
- const value = on ? 'true' : 'false';
671
- if (sessionStorage.getItem(DEBUG_MODE) !== value) {
672
- sessionStorage.setItem(DEBUG_MODE, value);
673
- window.location.reload();
674
- }
675
- };
676
- var main = () => { };
677
-
678
538
  const routerModule = RouterModule.forRoot(routes, { useHash: true, scrollPositionRestoration: 'top' });
679
539
  const toastrModule = ToastNoAnimationModule.forRoot({ maxOpened: 1, autoDismiss: true });
680
540
  // In angular 15, xsrf headerName should not be null. Angular 15 is not using default header value like it used to send in calls
@@ -871,6 +731,35 @@ AppModule = __decorate([
871
731
  __metadata("design:paramtypes", [App, Injector, ComponentRefProvider])
872
732
  ], AppModule);
873
733
 
734
+ const DEBUG_MODE = 'debugMode';
735
+ if (sessionStorage.getItem(DEBUG_MODE) !== 'true') {
736
+ enableProdMode();
737
+ }
738
+ console.time('bootstrap');
739
+ document.addEventListener('DOMContentLoaded', () => {
740
+ new Promise(resolve => {
741
+ resolve();
742
+ }).then(() => platformBrowserDynamic().bootstrapModule(AppModule))
743
+ .then((appModuleRef) => {
744
+ const applicationRef = appModuleRef.injector.get(ApplicationRef);
745
+ window.addEventListener('unload', () => {
746
+ applicationRef.components.map(c => c && c.destroy());
747
+ });
748
+ console.timeEnd('bootstrap');
749
+ }, err => console.log(err));
750
+ });
751
+ window.debugMode = function (on) {
752
+ if (isEmpty(on)) {
753
+ on = true;
754
+ }
755
+ const value = on ? 'true' : 'false';
756
+ if (sessionStorage.getItem(DEBUG_MODE) !== value) {
757
+ sessionStorage.setItem(DEBUG_MODE, value);
758
+ window.location.reload();
759
+ }
760
+ };
761
+ var main = () => { };
762
+
874
763
  /**
875
764
  * Generated bundle index. Do not edit.
876
765
  */