@magic-xpa/angular 4.1100.0-dev4110.6 → 4.1100.0-dev4110.60

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.
@@ -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) {
@@ -754,6 +757,10 @@ class GuiInteractiveExecutor {
754
757
  OnMessageBox() {
755
758
  this.overlayService.openConfirmationBox(this.command._mgValue.title, this.command._mgValue.str, this.command._mgValue.style);
756
759
  }
760
+ OnOpenForm() {
761
+ if (this.command._boolVal)
762
+ this.overlayService.loadAndOpenModule(this.command.controlName, this.command._mgValue.str, this.command._mgValue.path);
763
+ }
757
764
  OnSetTitle() {
758
765
  this.task.setTitle(this.command._mgValue.title);
759
766
  }
@@ -1277,17 +1284,42 @@ class confirmationBox {
1277
1284
  }
1278
1285
 
1279
1286
  class OverlayWindowService {
1280
- constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1287
+ constructor(componentFactoryResolver, componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1281
1288
  this.componentFactoryResolver = componentFactoryResolver;
1282
1289
  this.componentList = componentList;
1283
1290
  this.engineMagicService = engineMagicService;
1291
+ this.magicLazyModuleLoader = magicLazyModuleLoader;
1292
+ this.injector = injector;
1293
+ this.compiler = compiler;
1284
1294
  this.overlayContainerMagicProvider = overlayContainerMagicProvider;
1285
1295
  this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
1286
1296
  this.overlayWindowFocusManager = null;
1297
+ this.changeDetectorRef = null;
1287
1298
  }
1288
- init(overlayWindowsContainerViewRef, rootMagicElement) {
1299
+ init(overlayWindowsContainerViewRef, rootMagicElement, changeDetectorRef) {
1289
1300
  this.overlayWindowsContainerViewRef = overlayWindowsContainerViewRef;
1290
1301
  this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
1302
+ this.changeDetectorRef = changeDetectorRef;
1303
+ }
1304
+ loadAndOpenModule(formName, taskId, taskDescription) {
1305
+ let moduleRef = this.componentList.getModuleRef(formName);
1306
+ if (moduleRef == null) {
1307
+ let lazyLoadModule = this.componentList.getLazyLoadModuleData(formName);
1308
+ if (lazyLoadModule != null) {
1309
+ let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
1310
+ moduleName = moduleName.replace("Module", "");
1311
+ this.magicLazyModuleLoader.Load(moduleName).then(m => {
1312
+ const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1313
+ moduleRef = compiled.ngModuleFactory.create(this.injector);
1314
+ this.open(formName, taskId, taskDescription);
1315
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1316
+ });
1317
+ }
1318
+ }
1319
+ else {
1320
+ this.open(formName, taskId, taskDescription);
1321
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1322
+ }
1291
1323
  }
1292
1324
  open(formName, taskId, taskDescription) {
1293
1325
  let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
@@ -1298,6 +1330,7 @@ class OverlayWindowService {
1298
1330
  guiEvent.TaskID = taskId;
1299
1331
  this.engineMagicService.insertEvent(guiEvent);
1300
1332
  });
1333
+ this.changeDetectorRef.detectChanges();
1301
1334
  }
1302
1335
  close(commandStr) {
1303
1336
  this.overlayWindowsContainerViewRef.remove();
@@ -1343,14 +1376,14 @@ class OverlayWindowService {
1343
1376
  return componentRef;
1344
1377
  }
1345
1378
  }
1346
- 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)); };
1379
+ 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)); };
1347
1380
  OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
1348
1381
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
1349
1382
  type: Injectable,
1350
1383
  args: [{
1351
1384
  providedIn: 'root'
1352
1385
  }]
1353
- }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1386
+ }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1354
1387
  class OverlayWindowFocusManager {
1355
1388
  constructor(rootMagicElement) {
1356
1389
  this.rootMagicElement = null;
@@ -1886,7 +1919,7 @@ class TaskMagicService {
1886
1919
  if (isUndefined(val))
1887
1920
  return val;
1888
1921
  else
1889
- return (val != null) ? +val : null;
1922
+ return (val != null) ? (typeof val === 'string') ? val : +val : null;
1890
1923
  default:
1891
1924
  return val;
1892
1925
  }
@@ -1941,7 +1974,7 @@ class TaskMagicService {
1941
1974
  }
1942
1975
  onScrollDown() {
1943
1976
  if (!this.Records.includesLast) {
1944
- let guiEvent = getGuiEventObj('getRows', 'table', 0);
1977
+ let guiEvent = getGuiEventObj('getRows', '', 0);
1945
1978
  guiEvent.Line = this.formGroups.length;
1946
1979
  this.insertEvent(guiEvent);
1947
1980
  }
@@ -3991,7 +4024,7 @@ class MagicShellComponent {
3991
4024
  this.engineMagicService.TerminateContextUsingFetchAPI();
3992
4025
  }
3993
4026
  ngAfterViewInit() {
3994
- this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement);
4027
+ this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
3995
4028
  this.engineMagicService.startMagicEngine(this.httpClient);
3996
4029
  }
3997
4030
  setViewContainerRef(vcRef) {