@magic-xpa/angular 4.1000.0-dev4100.404 → 4.1000.0-dev4100.405

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.
@@ -18,9 +18,9 @@ import * as i1$1 from '@angular/platform-browser';
18
18
  import * as i1$2 from '@angular/common/http';
19
19
  import { HttpClientModule } from '@angular/common/http';
20
20
  import { maskitoTimeOptionsGenerator } from '@maskito/kit';
21
+ import * as i2$1 from '@angular/cdk/platform';
21
22
  import { MaskitoModule } from '@maskito/angular';
22
23
  import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
23
- import * as i1$3 from '@angular/cdk/platform';
24
24
 
25
25
  class ControlMetadata {
26
26
  constructor() {
@@ -718,6 +718,9 @@ class GuiInteractiveExecutor {
718
718
  case InteractiveCommandType.GET_LAST_ROUTE:
719
719
  this.OnGetLastRoute();
720
720
  break;
721
+ case InteractiveCommandType.OPEN_FORM:
722
+ this.OnOpenForm();
723
+ break;
721
724
  }
722
725
  }
723
726
  catch (ex) {
@@ -759,6 +762,10 @@ class GuiInteractiveExecutor {
759
762
  OnMessageBox() {
760
763
  this.overlayService.openConfirmationBox(this.command._mgValue.title, this.command._mgValue.str, this.command._mgValue.style);
761
764
  }
765
+ OnOpenForm() {
766
+ if (this.command._boolVal)
767
+ this.overlayService.loadAndOpenModule(this.command.controlName, this.command._mgValue.str, this.command._mgValue.path);
768
+ }
762
769
  OnSetTitle() {
763
770
  this.task.setTitle(this.command._mgValue.title);
764
771
  }
@@ -1282,17 +1289,42 @@ class confirmationBox {
1282
1289
  }
1283
1290
 
1284
1291
  class OverlayWindowService {
1285
- constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1292
+ constructor(componentFactoryResolver, componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1286
1293
  this.componentFactoryResolver = componentFactoryResolver;
1287
1294
  this.componentList = componentList;
1288
1295
  this.engineMagicService = engineMagicService;
1296
+ this.magicLazyModuleLoader = magicLazyModuleLoader;
1297
+ this.injector = injector;
1298
+ this.compiler = compiler;
1289
1299
  this.overlayContainerMagicProvider = overlayContainerMagicProvider;
1290
1300
  this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
1291
1301
  this.overlayWindowFocusManager = null;
1302
+ this.changeDetectorRef = null;
1292
1303
  }
1293
- init(overlayWindowsContainerViewRef, rootMagicElement) {
1304
+ init(overlayWindowsContainerViewRef, rootMagicElement, changeDetectorRef) {
1294
1305
  this.overlayWindowsContainerViewRef = overlayWindowsContainerViewRef;
1295
1306
  this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
1307
+ this.changeDetectorRef = changeDetectorRef;
1308
+ }
1309
+ loadAndOpenModule(formName, taskId, taskDescription) {
1310
+ let moduleRef = this.componentList.getModuleRef(formName);
1311
+ if (moduleRef == null) {
1312
+ let lazyLoadModule = this.componentList.getLazyLoadModuleData(formName);
1313
+ if (lazyLoadModule != null) {
1314
+ let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
1315
+ moduleName = moduleName.replace("Module", "");
1316
+ this.magicLazyModuleLoader.Load(moduleName).then(m => {
1317
+ const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1318
+ moduleRef = compiled.ngModuleFactory.create(this.injector);
1319
+ this.open(formName, taskId, taskDescription);
1320
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1321
+ });
1322
+ }
1323
+ }
1324
+ else {
1325
+ this.open(formName, taskId, taskDescription);
1326
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1327
+ }
1296
1328
  }
1297
1329
  open(formName, taskId, taskDescription) {
1298
1330
  let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
@@ -1303,6 +1335,7 @@ class OverlayWindowService {
1303
1335
  guiEvent.TaskID = taskId;
1304
1336
  this.engineMagicService.insertEvent(guiEvent);
1305
1337
  });
1338
+ this.changeDetectorRef.detectChanges();
1306
1339
  }
1307
1340
  close(commandStr) {
1308
1341
  this.overlayWindowsContainerViewRef.remove();
@@ -1348,14 +1381,14 @@ class OverlayWindowService {
1348
1381
  return componentRef;
1349
1382
  }
1350
1383
  }
1351
- OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
1384
+ OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
1352
1385
  OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
1353
1386
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
1354
1387
  type: Injectable,
1355
1388
  args: [{
1356
1389
  providedIn: 'root'
1357
1390
  }]
1358
- }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1391
+ }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1359
1392
  class OverlayWindowFocusManager {
1360
1393
  constructor(rootMagicElement) {
1361
1394
  this.rootMagicElement = null;
@@ -2775,11 +2808,12 @@ class MagicDirective {
2775
2808
  this.eventsOnlyVal = true;
2776
2809
  }
2777
2810
  ;
2778
- constructor(_task, element, renderer, vcRef, magicRow) {
2811
+ constructor(_task, element, renderer, vcRef, platform, magicRow) {
2779
2812
  this._task = _task;
2780
2813
  this.element = element;
2781
2814
  this.renderer = renderer;
2782
2815
  this.vcRef = vcRef;
2816
+ this.platform = platform;
2783
2817
  this.magicRow = magicRow;
2784
2818
  this.eventHandlers = {};
2785
2819
  this.eventsOnlyVal = false;
@@ -2801,6 +2835,8 @@ class MagicDirective {
2801
2835
  let fromButton = false;
2802
2836
  if (this.htmlElement instanceof HTMLButtonElement)
2803
2837
  fromButton = true;
2838
+ if (fromButton && (this.platform.IOS || this.platform.SAFARI))
2839
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
2804
2840
  this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
2805
2841
  if (MagicDirective.noOfAutoCompleteBoxesOpened < 1)
2806
2842
  e.cancelBubble = true;
@@ -2942,14 +2978,14 @@ class MagicDirective {
2942
2978
  }
2943
2979
  MagicDirective.opened = false;
2944
2980
  MagicDirective.noOfAutoCompleteBoxesOpened = 0;
2945
- MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
2981
+ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$1.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
2946
2982
  MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
2947
2983
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
2948
2984
  type: Directive,
2949
2985
  args: [{
2950
2986
  selector: "[magic]"
2951
2987
  }]
2952
- }], function () { return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
2988
+ }], function () { return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$1.Platform }, { type: RowMagicDirective, decorators: [{
2953
2989
  type: Optional
2954
2990
  }] }]; }, { magic: [{
2955
2991
  type: Input,
@@ -2964,8 +3000,8 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
2964
3000
  class NoControlMagicDirective extends MagicDirective {
2965
3001
  set magic(val) { this.id = val; this.selector = 'magicnc'; }
2966
3002
  ;
2967
- constructor(_task, element, renderer, vcRef, magicRow) {
2968
- super(_task, element, renderer, vcRef, magicRow);
3003
+ constructor(_task, element, renderer, vcRef, platform, magicRow) {
3004
+ super(_task, element, renderer, vcRef, platform, magicRow);
2969
3005
  }
2970
3006
  regEvents() {
2971
3007
  super.regEvents();
@@ -3127,14 +3163,14 @@ class NoControlMagicDirective extends MagicDirective {
3127
3163
  }
3128
3164
  }
3129
3165
  }
3130
- NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
3166
+ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$1.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
3131
3167
  NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
3132
3168
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
3133
3169
  type: Directive,
3134
3170
  args: [{
3135
3171
  selector: '[magicnc]'
3136
3172
  }]
3137
- }], function () { return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
3173
+ }], function () { return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$1.Platform }, { type: RowMagicDirective, decorators: [{
3138
3174
  type: Optional
3139
3175
  }] }]; }, { magic: [{
3140
3176
  type: Input,
@@ -4068,7 +4104,7 @@ class MagicShellComponent {
4068
4104
  this.engineMagicService.TerminateContextUsingFetchAPI();
4069
4105
  }
4070
4106
  ngAfterViewInit() {
4071
- this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement);
4107
+ this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
4072
4108
  this.engineMagicService.startMagicEngine(this.httpClient);
4073
4109
  }
4074
4110
  setViewContainerRef(vcRef) {
@@ -4635,11 +4671,11 @@ class MgDateAdapter extends NativeDateAdapter {
4635
4671
  }
4636
4672
  }
4637
4673
  }
4638
- MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
4674
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i2$1.Platform), i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
4639
4675
  MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4640
4676
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
4641
4677
  type: Injectable
4642
- }], function () { return [{ type: i1$3.Platform }, { type: TaskMagicService }, { type: undefined, decorators: [{
4678
+ }], function () { return [{ type: i2$1.Platform }, { type: TaskMagicService }, { type: undefined, decorators: [{
4643
4679
  type: Inject,
4644
4680
  args: [MAT_DATE_LOCALE]
4645
4681
  }] }]; }, null); })();