@magic-xpa/angular 4.1100.0-dev4110.16 → 4.1100.0-dev4110.160

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.
@@ -734,6 +734,9 @@ class GuiInteractiveExecutor {
734
734
  case InteractiveCommandType.GET_LAST_ROUTE:
735
735
  this.OnGetLastRoute();
736
736
  break;
737
+ case InteractiveCommandType.OPEN_FORM:
738
+ this.OnOpenForm();
739
+ break;
737
740
  }
738
741
  }
739
742
  catch (ex) {
@@ -770,6 +773,10 @@ class GuiInteractiveExecutor {
770
773
  OnMessageBox() {
771
774
  this.overlayService.openConfirmationBox(this.command._mgValue.title, this.command._mgValue.str, this.command._mgValue.style);
772
775
  }
776
+ OnOpenForm() {
777
+ if (this.command._boolVal)
778
+ this.overlayService.loadAndOpenModule(this.command.controlName, this.command._mgValue.str, this.command._mgValue.path);
779
+ }
773
780
  OnSetTitle() {
774
781
  this.task.setTitle(this.command._mgValue.title);
775
782
  }
@@ -1335,17 +1342,42 @@ ConfirmationComponentsMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: Co
1335
1342
  })();
1336
1343
 
1337
1344
  class OverlayWindowService {
1338
- constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1345
+ constructor(componentFactoryResolver, componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1339
1346
  this.componentFactoryResolver = componentFactoryResolver;
1340
1347
  this.componentList = componentList;
1341
1348
  this.engineMagicService = engineMagicService;
1349
+ this.magicLazyModuleLoader = magicLazyModuleLoader;
1350
+ this.injector = injector;
1351
+ this.compiler = compiler;
1342
1352
  this.overlayContainerMagicProvider = overlayContainerMagicProvider;
1343
1353
  this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
1344
1354
  this.overlayWindowFocusManager = null;
1355
+ this.changeDetectorRef = null;
1345
1356
  }
1346
- init(overlayWindowsContainerViewRef, rootMagicElement) {
1357
+ init(overlayWindowsContainerViewRef, rootMagicElement, changeDetectorRef) {
1347
1358
  this.overlayWindowsContainerViewRef = overlayWindowsContainerViewRef;
1348
1359
  this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
1360
+ this.changeDetectorRef = changeDetectorRef;
1361
+ }
1362
+ loadAndOpenModule(formName, taskId, taskDescription) {
1363
+ let moduleRef = this.componentList.getModuleRef(formName);
1364
+ if (moduleRef == null) {
1365
+ let lazyLoadModule = this.componentList.getLazyLoadModuleData(formName);
1366
+ if (lazyLoadModule != null) {
1367
+ let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
1368
+ moduleName = moduleName.replace("Module", "");
1369
+ this.magicLazyModuleLoader.Load(moduleName).then(m => {
1370
+ const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1371
+ moduleRef = compiled.ngModuleFactory.create(this.injector);
1372
+ this.open(formName, taskId, taskDescription);
1373
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1374
+ });
1375
+ }
1376
+ }
1377
+ else {
1378
+ this.open(formName, taskId, taskDescription);
1379
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1380
+ }
1349
1381
  }
1350
1382
  open(formName, taskId, taskDescription) {
1351
1383
  let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
@@ -1356,6 +1388,7 @@ class OverlayWindowService {
1356
1388
  guiEvent.TaskID = taskId;
1357
1389
  this.engineMagicService.insertEvent(guiEvent);
1358
1390
  });
1391
+ this.changeDetectorRef.detectChanges();
1359
1392
  }
1360
1393
  close(commandStr) {
1361
1394
  this.overlayWindowsContainerViewRef.remove();
@@ -1401,7 +1434,7 @@ class OverlayWindowService {
1401
1434
  return componentRef;
1402
1435
  }
1403
1436
  }
1404
- 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)); };
1437
+ 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)); };
1405
1438
  OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
1406
1439
  (function () {
1407
1440
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
@@ -1409,7 +1442,7 @@ OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowServ
1409
1442
  args: [{
1410
1443
  providedIn: 'root'
1411
1444
  }]
1412
- }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null);
1445
+ }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null);
1413
1446
  })();
1414
1447
  class OverlayWindowFocusManager {
1415
1448
  constructor(rootMagicElement) {
@@ -1946,7 +1979,7 @@ class TaskMagicService {
1946
1979
  if (isUndefined(val))
1947
1980
  return val;
1948
1981
  else
1949
- return (val != null) ? +val : null;
1982
+ return (val != null) ? (typeof val === 'string') ? val : +val : null;
1950
1983
  default:
1951
1984
  return val;
1952
1985
  }
@@ -2001,7 +2034,7 @@ class TaskMagicService {
2001
2034
  }
2002
2035
  onScrollDown() {
2003
2036
  if (!this.Records.includesLast) {
2004
- let guiEvent = getGuiEventObj('getRows', 'table', 0);
2037
+ let guiEvent = getGuiEventObj('getRows', '', 0);
2005
2038
  guiEvent.Line = this.formGroups.length;
2006
2039
  this.insertEvent(guiEvent);
2007
2040
  }
@@ -4129,7 +4162,7 @@ class MagicShellComponent {
4129
4162
  this.engineMagicService.TerminateContextUsingFetchAPI();
4130
4163
  }
4131
4164
  ngAfterViewInit() {
4132
- this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement);
4165
+ this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
4133
4166
  this.engineMagicService.startMagicEngine(this.httpClient);
4134
4167
  }
4135
4168
  setViewContainerRef(vcRef) {