@magic-xpa/angular 4.901.0-dev491.317 → 4.901.0-dev491.321

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.
@@ -716,6 +716,9 @@ class GuiInteractiveExecutor {
716
716
  case InteractiveCommandType.GET_LAST_ROUTE:
717
717
  this.OnGetLastRoute();
718
718
  break;
719
+ case InteractiveCommandType.OPEN_FORM:
720
+ this.OnOpenForm();
721
+ break;
719
722
  }
720
723
  }
721
724
  catch (ex) {
@@ -752,6 +755,10 @@ class GuiInteractiveExecutor {
752
755
  OnMessageBox() {
753
756
  this.overlayService.openConfirmationBox(this.command._mgValue.title, this.command._mgValue.str, this.command._mgValue.style);
754
757
  }
758
+ OnOpenForm() {
759
+ if (this.command._boolVal)
760
+ this.overlayService.loadAndOpenModule(this.command.controlName, this.command._mgValue.str, this.command._mgValue.path);
761
+ }
755
762
  OnSetTitle() {
756
763
  this.task.setTitle(this.command._mgValue.title);
757
764
  }
@@ -1365,17 +1372,42 @@ class confirmationBox {
1365
1372
  }
1366
1373
 
1367
1374
  class OverlayWindowService {
1368
- constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1375
+ constructor(componentFactoryResolver, componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1369
1376
  this.componentFactoryResolver = componentFactoryResolver;
1370
1377
  this.componentList = componentList;
1371
1378
  this.engineMagicService = engineMagicService;
1379
+ this.magicLazyModuleLoader = magicLazyModuleLoader;
1380
+ this.injector = injector;
1381
+ this.compiler = compiler;
1372
1382
  this.overlayContainerMagicProvider = overlayContainerMagicProvider;
1373
1383
  this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
1374
1384
  this.overlayWindowFocusManager = null;
1385
+ this.changeDetectorRef = null;
1375
1386
  }
1376
- init(overlayWindowsContainerViewRef, rootMagicElement) {
1387
+ init(overlayWindowsContainerViewRef, rootMagicElement, changeDetectorRef) {
1377
1388
  this.overlayWindowsContainerViewRef = overlayWindowsContainerViewRef;
1378
1389
  this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
1390
+ this.changeDetectorRef = changeDetectorRef;
1391
+ }
1392
+ loadAndOpenModule(formName, taskId, taskDescription) {
1393
+ let moduleRef = this.componentList.getModuleRef(formName);
1394
+ if (moduleRef == null) {
1395
+ let lazyLoadModule = this.componentList.getLazyLoadModuleData(formName);
1396
+ if (lazyLoadModule != null) {
1397
+ let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
1398
+ moduleName = moduleName.replace("Module", "");
1399
+ this.magicLazyModuleLoader.Load(moduleName).then(m => {
1400
+ const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1401
+ moduleRef = compiled.ngModuleFactory.create(this.injector);
1402
+ this.open(formName, taskId, taskDescription);
1403
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1404
+ });
1405
+ }
1406
+ }
1407
+ else {
1408
+ this.open(formName, taskId, taskDescription);
1409
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1410
+ }
1379
1411
  }
1380
1412
  open(formName, taskId, taskDescription) {
1381
1413
  let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
@@ -1386,6 +1418,7 @@ class OverlayWindowService {
1386
1418
  guiEvent.TaskID = taskId;
1387
1419
  this.engineMagicService.insertEvent(guiEvent);
1388
1420
  });
1421
+ this.changeDetectorRef.detectChanges();
1389
1422
  }
1390
1423
  close(commandStr) {
1391
1424
  this.overlayWindowsContainerViewRef.remove();
@@ -1431,14 +1464,14 @@ class OverlayWindowService {
1431
1464
  return componentRef;
1432
1465
  }
1433
1466
  }
1434
- 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)); };
1467
+ 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)); };
1435
1468
  OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
1436
1469
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
1437
1470
  type: Injectable,
1438
1471
  args: [{
1439
1472
  providedIn: 'root'
1440
1473
  }]
1441
- }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1474
+ }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1442
1475
  class OverlayWindowFocusManager {
1443
1476
  constructor(rootMagicElement) {
1444
1477
  this.rootMagicElement = null;
@@ -1961,7 +1994,10 @@ class TaskMagicService {
1961
1994
  return val;
1962
1995
  }
1963
1996
  case StorageAttribute.NUMERIC:
1964
- return +val;
1997
+ if (isUndefined(val))
1998
+ return val;
1999
+ else
2000
+ return (val != null) ? +val : null;
1965
2001
  default:
1966
2002
  return val;
1967
2003
  }
@@ -2190,7 +2226,7 @@ class TableMagicService {
2190
2226
  this.task.onScrollDown();
2191
2227
  }
2192
2228
  sortData(e) { }
2193
- mgOnPaginateChange(e) { }
2229
+ mgOnPaginateChange(e, changeSelectedRow) { }
2194
2230
  mgOptionChanged(e) { }
2195
2231
  updateTableSize(size) {
2196
2232
  if (size === 0) {
@@ -3861,7 +3897,7 @@ class MagicShellComponent {
3861
3897
  this.engineMagicService.TerminateContextUsingFetchAPI();
3862
3898
  }
3863
3899
  ngAfterViewInit() {
3864
- this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement);
3900
+ this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
3865
3901
  this.engineMagicService.startMagicEngine(this.httpClient);
3866
3902
  }
3867
3903
  setViewContainerRef(vcRef) {