@magic-xpa/angular 4.800.0-dev480.94 → 4.801.0-dev481.221

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.
@@ -669,6 +669,349 @@
669
669
  [utils$1.MagicProperties.Wallpaper, "background-image"]
670
670
  ]);
671
671
 
672
+ var CommandsCollectorMagicService = /** @class */ (function () {
673
+ function CommandsCollectorMagicService(magic) {
674
+ this.magic = magic;
675
+ this.count = 0;
676
+ this.commands = new mscorelib.List();
677
+ this.subscription = null;
678
+ }
679
+ CommandsCollectorMagicService.prototype.startCollecting = function () {
680
+ var _this = this;
681
+ this.count++;
682
+ utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- " + this.count);
683
+ if (this.subscription === null) {
684
+ this.subscription = this.magic.refreshDom
685
+ .subscribe(function (command) {
686
+ _this.commands.push(command);
687
+ });
688
+ }
689
+ };
690
+ CommandsCollectorMagicService.prototype.stopCollecting = function () {
691
+ this.count--;
692
+ utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- " + this.count);
693
+ if (this.count === 0) {
694
+ this.subscription.unsubscribe();
695
+ this.subscription = null;
696
+ }
697
+ };
698
+ CommandsCollectorMagicService.prototype.GetCommands = function (taskId) {
699
+ var _this = this;
700
+ var commands = this.commands.filter(function (command) { return command.TaskTag === taskId; });
701
+ commands.forEach(function (command) { _this.commands.Remove(command); });
702
+ return commands;
703
+ };
704
+ return CommandsCollectorMagicService;
705
+ }());
706
+ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
707
+ CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
708
+ (function () {
709
+ i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
710
+ type: i0.Injectable
711
+ }], function () { return [{ type: EngineMagicService }]; }, null);
712
+ })();
713
+
714
+ var RouteCommand = /** @class */ (function () {
715
+ function RouteCommand() {
716
+ }
717
+ return RouteCommand;
718
+ }());
719
+ var RouterCommandsMagicService = /** @class */ (function () {
720
+ function RouterCommandsMagicService() {
721
+ this.pendingRouteCommands = [];
722
+ }
723
+ RouterCommandsMagicService.prototype.AddRouteCommand = function (routeCommand) {
724
+ this.pendingRouteCommands.push(routeCommand);
725
+ };
726
+ RouterCommandsMagicService.prototype.ExecuteNextCommand = function () {
727
+ var pendingRouteCommand = this.pendingRouteCommands.shift();
728
+ if (!util.isNullOrUndefined(pendingRouteCommand)) {
729
+ pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
730
+ }
731
+ };
732
+ return RouterCommandsMagicService;
733
+ }());
734
+ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
735
+ RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
736
+ (function () {
737
+ i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
738
+ type: i0.Injectable
739
+ }], null, null);
740
+ })();
741
+
742
+ var SubformMagicService = /** @class */ (function () {
743
+ function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector) {
744
+ this.task = task;
745
+ this.activatedRoute = activatedRoute;
746
+ this.componentList = componentList;
747
+ this.pendingCommandsCollector = pendingCommandsCollector;
748
+ this.router = router;
749
+ this.routerCommandsMagicService = routerCommandsMagicService;
750
+ this.componentListMagicService = componentListMagicService;
751
+ this.loader = loader;
752
+ this.injector = injector;
753
+ this.subformsDict = {};
754
+ this.routesDict = {};
755
+ this.currentRouteDefinition = null;
756
+ }
757
+ SubformMagicService.prototype.mgGetComp = function (subformName) {
758
+ if (subformName in this.subformsDict) {
759
+ var formName = this.subformsDict[subformName].formName;
760
+ if (formName)
761
+ return this.componentList.getComponent(formName);
762
+ }
763
+ return null;
764
+ };
765
+ SubformMagicService.prototype.mgGetParameters = function (subformName) {
766
+ if (subformName in this.subformsDict) {
767
+ return this.subformsDict[subformName].parameters;
768
+ }
769
+ else
770
+ return "";
771
+ };
772
+ SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
773
+ if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
774
+ if (this.subformsDict[subformControlName].formName === formName) {
775
+ this.subformsDict[subformControlName] = {};
776
+ this.task.refreshView();
777
+ }
778
+ }
779
+ };
780
+ SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
781
+ var _this = this;
782
+ this.pendingCommandsCollector.startCollecting();
783
+ var refreshNeeded = false;
784
+ if (util.isNullOrUndefined(routerPath)) {
785
+ if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
786
+ if (this.subformsDict[subformControlName].formName === formName) {
787
+ this.subformsDict[subformControlName] = {};
788
+ this.task.refreshView();
789
+ }
790
+ }
791
+ var moduleRef_1 = this.componentListMagicService.getModuleRef(formName);
792
+ if (moduleRef_1 == null) {
793
+ var lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
794
+ if (lazyLoadModule != null) {
795
+ this.loader
796
+ .load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
797
+ .then(function (moduleFactory) {
798
+ moduleRef_1 = moduleFactory.create(_this.injector);
799
+ _this.subformsDict[subformControlName] = {
800
+ formName: formName,
801
+ parameters: { taskIdParam: taskId, taskDescription: taskDescription }
802
+ };
803
+ _this.task.refreshView();
804
+ });
805
+ }
806
+ }
807
+ else {
808
+ this.subformsDict[subformControlName] = {
809
+ formName: formName,
810
+ parameters: { taskIdParam: taskId, taskDescription: taskDescription }
811
+ };
812
+ refreshNeeded = true;
813
+ }
814
+ }
815
+ else {
816
+ if (inDefaultOutlet)
817
+ subformControlName = "primary";
818
+ var routeParams = new mscorelib.List();
819
+ routeParams.push(routerPath);
820
+ if (params !== null) {
821
+ routeParams = routeParams.concat(params);
822
+ }
823
+ var routeCommand = {
824
+ callerMgSubformServiceRef: this,
825
+ routerOutletName: subformControlName,
826
+ formName: formName,
827
+ parameters: { taskIdParam: taskId, taskDescription: taskDescription },
828
+ routeParams: routeParams
829
+ };
830
+ if (SubformMagicService.currentCallerMgSubformServiceRef === null)
831
+ this.ExecuteRouteCommand(routeCommand);
832
+ else
833
+ this.routerCommandsMagicService.AddRouteCommand(routeCommand);
834
+ }
835
+ if (refreshNeeded)
836
+ this.task.refreshView();
837
+ };
838
+ SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
839
+ var _a;
840
+ var reusingComponent = false;
841
+ var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
842
+ var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
843
+ if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
844
+ currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
845
+ .then(function (result) {
846
+ SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
847
+ currentSubformMagicService.currentRouteDefinition = {
848
+ formName: routeCommand.formName,
849
+ parameters: routeCommand.parameters
850
+ };
851
+ currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
852
+ });
853
+ }
854
+ else {
855
+ SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
856
+ currentSubformMagicService.currentRouteDefinition = {
857
+ formName: routeCommand.formName,
858
+ parameters: routeCommand.parameters
859
+ };
860
+ if (SubformMagicService.routerContainers.length > 0) {
861
+ var routeContainer = SubformMagicService.routerContainers[0];
862
+ SubformMagicService.routerContainers.shift();
863
+ routeContainer.initializeComponent();
864
+ }
865
+ else {
866
+ currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
867
+ }
868
+ }
869
+ };
870
+ SubformMagicService.prototype.PerformRouterNavigate = function (routerOutletName, routeParams) {
871
+ var _a;
872
+ var relativeRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
873
+ this.router.navigate([{ outlets: (_a = {}, _a[routerOutletName] = routeParams, _a) }], { relativeTo: relativeRoute })
874
+ .then(function (result) {
875
+ if (result !== null && !result) {
876
+ var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
877
+ subformMagicService.currentRouteDefinition = null;
878
+ SubformMagicService.currentCallerMgSubformServiceRef = null;
879
+ subformMagicService.pendingCommandsCollector.stopCollecting();
880
+ subformMagicService.routerCommandsMagicService.ExecuteNextCommand();
881
+ }
882
+ });
883
+ };
884
+ SubformMagicService.prototype.init = function () {
885
+ var _this = this;
886
+ var pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
887
+ if (pendingCommands.length > 0) {
888
+ pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
889
+ this.task.refreshView();
890
+ }
891
+ this.pendingCommandsCollector.stopCollecting();
892
+ };
893
+ SubformMagicService.prototype.refreshView = function () {
894
+ this.task.refreshView();
895
+ };
896
+ SubformMagicService.getRelativeRoute = function (sendActivatedRoute) {
897
+ var currentActiveRoute = sendActivatedRoute;
898
+ if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
899
+ currentActiveRoute = currentActiveRoute.parent;
900
+ if (!currentActiveRoute.snapshot.routeConfig.loadChildren)
901
+ console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.");
902
+ }
903
+ return currentActiveRoute;
904
+ };
905
+ return SubformMagicService;
906
+ }());
907
+ SubformMagicService.currentCallerMgSubformServiceRef = null;
908
+ SubformMagicService.routerContainers = new Array();
909
+ SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(i0.NgModuleFactoryLoader), i0.ɵɵinject(i0.Injector)); };
910
+ SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
911
+ (function () {
912
+ i0.ɵsetClassMetadata(SubformMagicService, [{
913
+ type: i0.Injectable
914
+ }], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: i0.NgModuleFactoryLoader }, { type: i0.Injector }]; }, null);
915
+ })();
916
+
917
+ var RouterContainerMagicComponent = /** @class */ (function () {
918
+ function RouterContainerMagicComponent(activatedRoute, router, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
919
+ this.activatedRoute = activatedRoute;
920
+ this.router = router;
921
+ this.magic = magic;
922
+ this.containerTaskService = containerTaskService;
923
+ this.componentFactoryResolver = componentFactoryResolver;
924
+ this.viewContainerRef = viewContainerRef;
925
+ this.componentList = componentList;
926
+ this.pendingCommandsCollector = pendingCommandsCollector;
927
+ this.routerCommandsMagicService = routerCommandsMagicService;
928
+ this.componentRef = null;
929
+ this.parentMgSubformService = null;
930
+ }
931
+ Object.defineProperty(RouterContainerMagicComponent, "LastRoute", {
932
+ get: function () {
933
+ return RouterContainerMagicComponent.lastRoute;
934
+ },
935
+ enumerable: false,
936
+ configurable: true
937
+ });
938
+ RouterContainerMagicComponent.prototype.ngOnInit = function () {
939
+ var outletname = this.activatedRoute.outlet;
940
+ var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
941
+ var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
942
+ RouterContainerMagicComponent.lastRoute = this.router.url;
943
+ if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
944
+ this.insertRouteEvent(currentActiveRoute);
945
+ SubformMagicService.routerContainers.push(this);
946
+ }
947
+ else {
948
+ this.initializeComponent();
949
+ }
950
+ };
951
+ RouterContainerMagicComponent.prototype.insertRouteEvent = function (currentActiveRoute) {
952
+ var guiEvent = engine.getGuiEventObj('RouterNavigate', null, 0);
953
+ guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
954
+ if (currentActiveRoute.snapshot.outlet !== 'primary')
955
+ guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
956
+ var calcRouterPath = currentActiveRoute.routeConfig.path;
957
+ if (calcRouterPath.length > 0) {
958
+ var routerPath = calcRouterPath;
959
+ var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
960
+ guiEvent.RouterPath = tokens[0];
961
+ guiEvent.RouterParams = new mscorelib.List();
962
+ for (var i = 1; i < tokens.length; i++) {
963
+ guiEvent.RouterParams.push(this.activatedRoute.snapshot.params[tokens[i]]);
964
+ }
965
+ }
966
+ this.containerTaskService.insertEvent(guiEvent);
967
+ };
968
+ RouterContainerMagicComponent.prototype.initializeComponent = function () {
969
+ var _this = this;
970
+ var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
971
+ if (subformMagicService.currentRouteDefinition !== null) {
972
+ var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
973
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
974
+ this.componentRef = this.viewContainerRef.createComponent(componentFactory);
975
+ Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
976
+ var myActiveRoute_1 = SubformMagicService.getRelativeRoute(this.activatedRoute);
977
+ var routeParams = utils$1.StrUtil.tokenize(myActiveRoute_1.snapshot.routeConfig.path, "/:");
978
+ subformMagicService.routesDict[myActiveRoute_1.snapshot.outlet] = routeParams[0];
979
+ this.parentMgSubformService = subformMagicService;
980
+ subformMagicService.currentRouteDefinition = null;
981
+ SubformMagicService.currentCallerMgSubformServiceRef = null;
982
+ var ignoreParamChange_1 = true;
983
+ myActiveRoute_1.paramMap.subscribe(function (params) {
984
+ if (!ignoreParamChange_1)
985
+ _this.insertRouteEvent(myActiveRoute_1);
986
+ ignoreParamChange_1 = false;
987
+ });
988
+ this.parentMgSubformService.refreshView();
989
+ this.routerCommandsMagicService.ExecuteNextCommand();
990
+ }
991
+ };
992
+ RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
993
+ if (this.componentRef != null) {
994
+ this.componentRef.instance.task.close();
995
+ var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
996
+ this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
997
+ RouterContainerMagicComponent.lastRoute = this.router.url;
998
+ }
999
+ };
1000
+ return RouterContainerMagicComponent;
1001
+ }());
1002
+ RouterContainerMagicComponent.lastRoute = "/";
1003
+ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
1004
+ RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
1005
+ (function () {
1006
+ i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
1007
+ type: i0.Component,
1008
+ args: [{
1009
+ selector: 'magic-route-outlet',
1010
+ template: "\n "
1011
+ }]
1012
+ }], function () { return [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
1013
+ })();
1014
+
672
1015
  var GuiInteractiveExecutor = /** @class */ (function () {
673
1016
  function GuiInteractiveExecutor() {
674
1017
  }
@@ -699,6 +1042,9 @@
699
1042
  case gui.InteractiveCommandType.REFRESH_PAGE:
700
1043
  this.OnRefreshPage();
701
1044
  break;
1045
+ case gui.InteractiveCommandType.GET_LAST_ROUTE:
1046
+ this.OnGetLastRoute();
1047
+ break;
702
1048
  }
703
1049
  }
704
1050
  catch (ex) {
@@ -758,6 +1104,9 @@
758
1104
  else
759
1105
  this.command._boolVal = this.task.Records.list[guiRowIndex].isEditing;
760
1106
  };
1107
+ GuiInteractiveExecutor.prototype.OnGetLastRoute = function () {
1108
+ this.command.resultString = RouterContainerMagicComponent.LastRoute;
1109
+ };
761
1110
  return GuiInteractiveExecutor;
762
1111
  }());
763
1112
 
@@ -1853,6 +2202,7 @@
1853
2202
  control.setValidators([control.validator, this.customValidator(guiRowId.toString(), controlId)]);
1854
2203
  else
1855
2204
  control.setValidators(this.customValidator(guiRowId.toString(), controlId));
2205
+ control.updateValueAndValidity();
1856
2206
  }
1857
2207
  }
1858
2208
  break;
@@ -1865,7 +2215,7 @@
1865
2215
  properties.setStyle(command.Operation, command.obj1);
1866
2216
  break;
1867
2217
  case gui.CommandType.SET_ATTRIBUTE:
1868
- properties = this.Records.list[guiRowId].getControlMetadata(controlId);
2218
+ properties = this.Records.list[0].getControlMetadata(controlId);
1869
2219
  properties.dataType = String.fromCharCode(command.number);
1870
2220
  break;
1871
2221
  case gui.CommandType.SET_VALUE:
@@ -2042,335 +2392,112 @@
2042
2392
  }
2043
2393
  else {
2044
2394
  if (!util.isNullOrUndefined(event.target)) {
2045
- var indexes = new Array(event.target.selectedOptions.length);
2046
- for (var i = 0; i < event.target.selectedOptions.length; i++) {
2047
- indexes[i] = event.target.selectedOptions[i].index;
2048
- }
2049
- guiEvent.Value = indexes.join(',');
2050
- }
2051
- else
2052
- guiEvent.Value = event.value;
2053
- }
2054
- this.insertEvent(guiEvent);
2055
- };
2056
- TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
2057
- var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2058
- var selectedOptions;
2059
- if (!util.isNullOrUndefined(event.target))
2060
- selectedOptions = event.target.selectedOptions;
2061
- else
2062
- selectedOptions = event.source.selectedOptions.selected;
2063
- var length = selectedOptions.length;
2064
- var indexes = new Array(length);
2065
- for (var i = 0; i < length; i++) {
2066
- if (!util.isNullOrUndefined(event.target))
2067
- indexes[i] = (selectedOptions[i]).index;
2068
- else
2069
- indexes[i] = (selectedOptions[i]).value;
2070
- }
2071
- guiEvent.Value = indexes;
2072
- this.insertEvent(guiEvent);
2073
- };
2074
- TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
2075
- if (typeof rowId === 'undefined')
2076
- rowId = 0;
2077
- var guiEvent = engine.getGuiEventObj('selectionchanged', idx, rowId);
2078
- if (typeof (event) == 'boolean') {
2079
- guiEvent.Value = event;
2080
- }
2081
- else {
2082
- if (typeof event.target === 'undefined')
2083
- guiEvent.Value = (event).checked;
2084
- else
2085
- guiEvent.Value = (event.target).checked;
2086
- }
2087
- this.insertEvent(guiEvent);
2088
- };
2089
- TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
2090
- var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2091
- guiEvent.Value = layer.toString();
2092
- this.insertEvent(guiEvent);
2093
- };
2094
- TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
2095
- var result = this.getFormControl('0', idx);
2096
- var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2097
- if (typeof result.value !== 'string')
2098
- guiEvent.Value = result.value.index;
2099
- else
2100
- guiEvent.Value = result.value;
2101
- this.insertEvent(guiEvent);
2102
- };
2103
- TaskMagicService.prototype.close = function () {
2104
- this.insertEvent(engine.getGuiEventObj('close', null, 0));
2105
- };
2106
- TaskMagicService.prototype.IsStub = function () {
2107
- return this.magic.isStub;
2108
- };
2109
- TaskMagicService.prototype.saveData = function (data) {
2110
- this.magic.saveData(data);
2111
- };
2112
- TaskMagicService.prototype.createData = function () {
2113
- var myData = {
2114
- records: this.Records,
2115
- template: this.template
2116
- };
2117
- var text = 'loadData():any {\n' +
2118
- ' let stubData = ' + JSON.stringify(myData) + ';\n' +
2119
- ' this.loadStubData(stubData);}';
2120
- console.log(text);
2121
- this.saveData(text);
2122
- };
2123
- TaskMagicService.prototype.loadStubData = function (stubData) {
2124
- this.Records = stubData.records;
2125
- this.settemplate(stubData.template);
2126
- this.taskId = '1';
2127
- for (var i = 0; i < this.Records.list.length; i++)
2128
- this.buildTableRowControls(i);
2129
- };
2130
- TaskMagicService.prototype.loadData = function () {
2131
- alert('Please, overwrite method loadData');
2132
- };
2133
- TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
2134
- if (this.IsStub()) {
2135
- try {
2136
- var val = this.Records.list[guiRowId].values[name];
2137
- fc.setValue(val);
2138
- }
2139
- catch (e) {
2140
- }
2141
- }
2142
- };
2143
- return TaskMagicService;
2144
- }());
2145
- TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
2146
- TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
2147
- (function () {
2148
- i0.ɵsetClassMetadata(TaskMagicService, [{
2149
- type: i0.Injectable
2150
- }], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
2151
- })();
2152
-
2153
- var CommandsCollectorMagicService = /** @class */ (function () {
2154
- function CommandsCollectorMagicService(magic) {
2155
- this.magic = magic;
2156
- this.count = 0;
2157
- this.commands = new mscorelib.List();
2158
- this.subscription = null;
2159
- }
2160
- CommandsCollectorMagicService.prototype.startCollecting = function () {
2161
- var _this = this;
2162
- this.count++;
2163
- utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- " + this.count);
2164
- if (this.subscription === null) {
2165
- this.subscription = this.magic.refreshDom
2166
- .subscribe(function (command) {
2167
- _this.commands.push(command);
2168
- });
2169
- }
2170
- };
2171
- CommandsCollectorMagicService.prototype.stopCollecting = function () {
2172
- this.count--;
2173
- utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- " + this.count);
2174
- if (this.count === 0) {
2175
- this.subscription.unsubscribe();
2176
- this.subscription = null;
2177
- }
2178
- };
2179
- CommandsCollectorMagicService.prototype.GetCommands = function (taskId) {
2180
- var _this = this;
2181
- var commands = this.commands.filter(function (command) { return command.TaskTag === taskId; });
2182
- commands.forEach(function (command) { _this.commands.Remove(command); });
2183
- return commands;
2184
- };
2185
- return CommandsCollectorMagicService;
2186
- }());
2187
- CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
2188
- CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
2189
- (function () {
2190
- i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
2191
- type: i0.Injectable
2192
- }], function () { return [{ type: EngineMagicService }]; }, null);
2193
- })();
2194
-
2195
- var RouteCommand = /** @class */ (function () {
2196
- function RouteCommand() {
2197
- }
2198
- return RouteCommand;
2199
- }());
2200
- var RouterCommandsMagicService = /** @class */ (function () {
2201
- function RouterCommandsMagicService() {
2202
- this.pendingRouteCommands = [];
2203
- }
2204
- RouterCommandsMagicService.prototype.AddRouteCommand = function (routeCommand) {
2205
- this.pendingRouteCommands.push(routeCommand);
2206
- };
2207
- RouterCommandsMagicService.prototype.ExecuteNextCommand = function () {
2208
- var pendingRouteCommand = this.pendingRouteCommands.shift();
2209
- if (!util.isNullOrUndefined(pendingRouteCommand)) {
2210
- pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
2211
- }
2212
- };
2213
- return RouterCommandsMagicService;
2214
- }());
2215
- RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
2216
- RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
2217
- (function () {
2218
- i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
2219
- type: i0.Injectable
2220
- }], null, null);
2221
- })();
2222
-
2223
- var SubformMagicService = /** @class */ (function () {
2224
- function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
2225
- this.task = task;
2226
- this.activatedRoute = activatedRoute;
2227
- this.componentList = componentList;
2228
- this.pendingCommandsCollector = pendingCommandsCollector;
2229
- this.router = router;
2230
- this.routerCommandsMagicService = routerCommandsMagicService;
2231
- this.subformsDict = {};
2232
- this.routesDict = {};
2233
- this.currentRouteDefinition = null;
2234
- }
2235
- SubformMagicService.prototype.mgGetComp = function (subformName) {
2236
- if (subformName in this.subformsDict) {
2237
- var formName = this.subformsDict[subformName].formName;
2238
- if (formName)
2239
- return this.componentList.getComponent(formName);
2240
- }
2241
- return null;
2242
- };
2243
- SubformMagicService.prototype.mgGetParameters = function (subformName) {
2244
- if (subformName in this.subformsDict) {
2245
- return this.subformsDict[subformName].parameters;
2246
- }
2247
- else
2248
- return "";
2249
- };
2250
- SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
2251
- if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2252
- if (this.subformsDict[subformControlName].formName === formName) {
2253
- this.subformsDict[subformControlName] = {};
2254
- this.task.refreshView();
2255
- }
2256
- }
2257
- };
2258
- SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
2259
- this.pendingCommandsCollector.startCollecting();
2260
- var refreshNeeded = false;
2261
- if (util.isNullOrUndefined(routerPath)) {
2262
- if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2263
- if (this.subformsDict[subformControlName].formName === formName) {
2264
- this.subformsDict[subformControlName] = {};
2265
- this.task.refreshView();
2266
- }
2267
- }
2268
- this.subformsDict[subformControlName] = {
2269
- formName: formName,
2270
- parameters: { taskIdParam: taskId, taskDescription: taskDescription }
2271
- };
2272
- refreshNeeded = true;
2273
- }
2274
- else {
2275
- if (inDefaultOutlet)
2276
- subformControlName = "primary";
2277
- var routeParams = new mscorelib.List();
2278
- routeParams.push(routerPath);
2279
- if (params !== null) {
2280
- routeParams = routeParams.concat(params);
2395
+ var indexes = new Array(event.target.selectedOptions.length);
2396
+ for (var i = 0; i < event.target.selectedOptions.length; i++) {
2397
+ indexes[i] = event.target.selectedOptions[i].index;
2398
+ }
2399
+ guiEvent.Value = indexes.join(',');
2281
2400
  }
2282
- var routeCommand = {
2283
- callerMgSubformServiceRef: this,
2284
- routerOutletName: subformControlName,
2285
- formName: formName,
2286
- parameters: { taskIdParam: taskId, taskDescription: taskDescription },
2287
- routeParams: routeParams
2288
- };
2289
- if (SubformMagicService.currentCallerMgSubformServiceRef === null)
2290
- this.ExecuteRouteCommand(routeCommand);
2291
2401
  else
2292
- this.routerCommandsMagicService.AddRouteCommand(routeCommand);
2402
+ guiEvent.Value = event.value;
2293
2403
  }
2294
- if (refreshNeeded)
2295
- this.task.refreshView();
2404
+ this.insertEvent(guiEvent);
2296
2405
  };
2297
- SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
2298
- var _a;
2299
- var reusingComponent = false;
2300
- var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
2301
- var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
2302
- if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
2303
- currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
2304
- .then(function (result) {
2305
- SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
2306
- currentSubformMagicService.currentRouteDefinition = {
2307
- formName: routeCommand.formName,
2308
- parameters: routeCommand.parameters
2309
- };
2310
- currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
2311
- });
2406
+ TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
2407
+ var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2408
+ var selectedOptions;
2409
+ if (!util.isNullOrUndefined(event.target))
2410
+ selectedOptions = event.target.selectedOptions;
2411
+ else
2412
+ selectedOptions = event.source.selectedOptions.selected;
2413
+ var length = selectedOptions.length;
2414
+ var indexes = new Array(length);
2415
+ for (var i = 0; i < length; i++) {
2416
+ if (!util.isNullOrUndefined(event.target))
2417
+ indexes[i] = (selectedOptions[i]).index;
2418
+ else
2419
+ indexes[i] = (selectedOptions[i]).value;
2420
+ }
2421
+ guiEvent.Value = indexes;
2422
+ this.insertEvent(guiEvent);
2423
+ };
2424
+ TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
2425
+ if (typeof rowId === 'undefined')
2426
+ rowId = 0;
2427
+ var guiEvent = engine.getGuiEventObj('selectionchanged', idx, rowId);
2428
+ if (typeof (event) == 'boolean') {
2429
+ guiEvent.Value = event;
2312
2430
  }
2313
2431
  else {
2314
- SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
2315
- currentSubformMagicService.currentRouteDefinition = {
2316
- formName: routeCommand.formName,
2317
- parameters: routeCommand.parameters
2318
- };
2319
- if (SubformMagicService.routerContainers.length > 0) {
2320
- var routeContainer = SubformMagicService.routerContainers[0];
2321
- SubformMagicService.routerContainers.shift();
2322
- routeContainer.initializeComponent();
2323
- }
2324
- else {
2325
- currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
2326
- }
2432
+ if (typeof event.target === 'undefined')
2433
+ guiEvent.Value = (event).checked;
2434
+ else
2435
+ guiEvent.Value = (event.target).checked;
2327
2436
  }
2437
+ this.insertEvent(guiEvent);
2328
2438
  };
2329
- SubformMagicService.prototype.PerformRouterNavigate = function (routerOutletName, routeParams) {
2330
- var _a;
2331
- var relativeRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
2332
- this.router.navigate([{ outlets: (_a = {}, _a[routerOutletName] = routeParams, _a) }], { relativeTo: relativeRoute })
2333
- .then(function (result) {
2334
- if (result !== null && !result) {
2335
- var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
2336
- subformMagicService.currentRouteDefinition = null;
2337
- SubformMagicService.currentCallerMgSubformServiceRef = null;
2338
- subformMagicService.pendingCommandsCollector.stopCollecting();
2339
- subformMagicService.routerCommandsMagicService.ExecuteNextCommand();
2340
- }
2341
- });
2439
+ TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
2440
+ var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2441
+ guiEvent.Value = layer.toString();
2442
+ this.insertEvent(guiEvent);
2342
2443
  };
2343
- SubformMagicService.prototype.init = function () {
2344
- var _this = this;
2345
- var pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
2346
- if (pendingCommands.length > 0) {
2347
- pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
2348
- this.task.refreshView();
2349
- }
2350
- this.pendingCommandsCollector.stopCollecting();
2444
+ TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
2445
+ var result = this.getFormControl('0', idx);
2446
+ var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2447
+ if (typeof result.value !== 'string')
2448
+ guiEvent.Value = result.value.index;
2449
+ else
2450
+ guiEvent.Value = result.value;
2451
+ this.insertEvent(guiEvent);
2351
2452
  };
2352
- SubformMagicService.prototype.refreshView = function () {
2353
- this.task.refreshView();
2453
+ TaskMagicService.prototype.close = function () {
2454
+ this.insertEvent(engine.getGuiEventObj('close', null, 0));
2354
2455
  };
2355
- SubformMagicService.getRelativeRoute = function (sendActivatedRoute) {
2356
- var currentActiveRoute = sendActivatedRoute;
2357
- if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
2358
- currentActiveRoute = currentActiveRoute.parent;
2359
- if (!currentActiveRoute.snapshot.routeConfig.loadChildren)
2360
- console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.");
2456
+ TaskMagicService.prototype.IsStub = function () {
2457
+ return this.magic.isStub;
2458
+ };
2459
+ TaskMagicService.prototype.saveData = function (data) {
2460
+ this.magic.saveData(data);
2461
+ };
2462
+ TaskMagicService.prototype.createData = function () {
2463
+ var myData = {
2464
+ records: this.Records,
2465
+ template: this.template
2466
+ };
2467
+ var text = 'loadData():any {\n' +
2468
+ ' let stubData = ' + JSON.stringify(myData) + ';\n' +
2469
+ ' this.loadStubData(stubData);}';
2470
+ console.log(text);
2471
+ this.saveData(text);
2472
+ };
2473
+ TaskMagicService.prototype.loadStubData = function (stubData) {
2474
+ this.Records = stubData.records;
2475
+ this.settemplate(stubData.template);
2476
+ this.taskId = '1';
2477
+ for (var i = 0; i < this.Records.list.length; i++)
2478
+ this.buildTableRowControls(i);
2479
+ };
2480
+ TaskMagicService.prototype.loadData = function () {
2481
+ alert('Please, overwrite method loadData');
2482
+ };
2483
+ TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
2484
+ if (this.IsStub()) {
2485
+ try {
2486
+ var val = this.Records.list[guiRowId].values[name];
2487
+ fc.setValue(val);
2488
+ }
2489
+ catch (e) {
2490
+ }
2361
2491
  }
2362
- return currentActiveRoute;
2363
2492
  };
2364
- return SubformMagicService;
2493
+ return TaskMagicService;
2365
2494
  }());
2366
- SubformMagicService.currentCallerMgSubformServiceRef = null;
2367
- SubformMagicService.routerContainers = new Array();
2368
- SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService)); };
2369
- SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
2495
+ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
2496
+ TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
2370
2497
  (function () {
2371
- i0.ɵsetClassMetadata(SubformMagicService, [{
2498
+ i0.ɵsetClassMetadata(TaskMagicService, [{
2372
2499
  type: i0.Injectable
2373
- }], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }]; }, null);
2500
+ }], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
2374
2501
  })();
2375
2502
 
2376
2503
  var TableMagicService = /** @class */ (function () {
@@ -2607,6 +2734,18 @@
2607
2734
  AccessorMagicService.prototype.getItemListValues = function (id, rowId) {
2608
2735
  return this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
2609
2736
  };
2737
+ AccessorMagicService.prototype.getFilteredList = function (controlId, rowId) {
2738
+ if (util.isNullOrUndefined(rowId))
2739
+ rowId = '0';
2740
+ var items = this.getItemListValues(controlId, rowId);
2741
+ var value = this.task.getFormControl(rowId, controlId).value;
2742
+ if (value !== null && value !== "" && items instanceof Array) {
2743
+ value = value.toLowerCase();
2744
+ return items.filter(function (option) { return option.displayValue.toLowerCase().includes(value); });
2745
+ }
2746
+ else
2747
+ return items;
2748
+ };
2610
2749
  AccessorMagicService.prototype.getDisplayValue = function (id, rowId) {
2611
2750
  var displayValue = "";
2612
2751
  var o = this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
@@ -2921,7 +3060,8 @@
2921
3060
  RowMagicDirective.prototype.onClick = function ($event) {
2922
3061
  if (this.rowId != '') {
2923
3062
  this._task.insertEvent(engine.getGuiEventObj('click', "magicRow", +this.rowId));
2924
- event.cancelBubble = true;
3063
+ if (MagicDirective.noOfAutoCompleteBoxesOpened < 1)
3064
+ event.cancelBubble = true;
2925
3065
  }
2926
3066
  };
2927
3067
  return RowMagicDirective;
@@ -2998,7 +3138,8 @@
2998
3138
  if (_this.htmlElement instanceof HTMLButtonElement)
2999
3139
  fromButton = true;
3000
3140
  _this.task.insertEvent(engine.getGuiEventObj(event, _this.id, +_this.rowId, fromButton));
3001
- e.cancelBubble = true;
3141
+ if (MagicDirective.noOfAutoCompleteBoxesOpened < 1)
3142
+ e.cancelBubble = true;
3002
3143
  });
3003
3144
  });
3004
3145
  this.renderer.listen(this.htmlElement, 'change', function (e) {
@@ -3038,7 +3179,7 @@
3038
3179
  (e.keyCode >= gui.GuiConstants.KEY_F1 && e.keyCode <= gui.GuiConstants.KEY_F12);
3039
3180
  if (guiEvent.modifiers !== gui.Modifiers.MODIFIER_NONE || supportedKey) {
3040
3181
  guiEvent.keyCode = e.keyCode;
3041
- if (e.keyCode !== gui.GuiConstants.KEY_ESC || e.keyCode === gui.GuiConstants.KEY_ESC && !MagicDirective.opened)
3182
+ if (e.keyCode !== gui.GuiConstants.KEY_ESC || e.keyCode === gui.GuiConstants.KEY_ESC && (!MagicDirective.opened && MagicDirective.noOfAutoCompleteBoxesOpened < 1))
3042
3183
  e.cancelBubble = true;
3043
3184
  _this.task.insertEvent(guiEvent);
3044
3185
  }
@@ -3135,6 +3276,7 @@
3135
3276
  return MagicDirective;
3136
3277
  }());
3137
3278
  MagicDirective.opened = false;
3279
+ MagicDirective.noOfAutoCompleteBoxesOpened = 0;
3138
3280
  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)); };
3139
3281
  MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
3140
3282
  (function () {
@@ -3361,93 +3503,6 @@
3361
3503
  }] });
3362
3504
  })();
3363
3505
 
3364
- var RouterContainerMagicComponent = /** @class */ (function () {
3365
- function RouterContainerMagicComponent(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
3366
- this.activatedRoute = activatedRoute;
3367
- this.magic = magic;
3368
- this.containerTaskService = containerTaskService;
3369
- this.componentFactoryResolver = componentFactoryResolver;
3370
- this.viewContainerRef = viewContainerRef;
3371
- this.componentList = componentList;
3372
- this.pendingCommandsCollector = pendingCommandsCollector;
3373
- this.routerCommandsMagicService = routerCommandsMagicService;
3374
- this.componentRef = null;
3375
- this.parentMgSubformService = null;
3376
- }
3377
- RouterContainerMagicComponent.prototype.ngOnInit = function () {
3378
- var outletname = this.activatedRoute.outlet;
3379
- var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
3380
- var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
3381
- if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
3382
- this.insertRouteEvent(currentActiveRoute);
3383
- SubformMagicService.routerContainers.push(this);
3384
- }
3385
- else {
3386
- this.initializeComponent();
3387
- }
3388
- };
3389
- RouterContainerMagicComponent.prototype.insertRouteEvent = function (currentActiveRoute) {
3390
- var guiEvent = engine.getGuiEventObj('RouterNavigate', null, 0);
3391
- guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
3392
- if (currentActiveRoute.snapshot.outlet !== 'primary')
3393
- guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
3394
- var calcRouterPath = currentActiveRoute.routeConfig.path;
3395
- if (calcRouterPath.length > 0) {
3396
- var routerPath = calcRouterPath;
3397
- var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
3398
- guiEvent.RouterPath = tokens[0];
3399
- guiEvent.RouterParams = new mscorelib.List();
3400
- for (var i = 1; i < tokens.length; i++) {
3401
- guiEvent.RouterParams.push(this.activatedRoute.snapshot.params[tokens[i]]);
3402
- }
3403
- }
3404
- this.containerTaskService.insertEvent(guiEvent);
3405
- };
3406
- RouterContainerMagicComponent.prototype.initializeComponent = function () {
3407
- var _this = this;
3408
- var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
3409
- if (subformMagicService.currentRouteDefinition !== null) {
3410
- var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
3411
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
3412
- this.componentRef = this.viewContainerRef.createComponent(componentFactory);
3413
- Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
3414
- var myActiveRoute_1 = SubformMagicService.getRelativeRoute(this.activatedRoute);
3415
- var routeParams = utils$1.StrUtil.tokenize(myActiveRoute_1.snapshot.routeConfig.path, "/:");
3416
- subformMagicService.routesDict[myActiveRoute_1.snapshot.outlet] = routeParams[0];
3417
- this.parentMgSubformService = subformMagicService;
3418
- subformMagicService.currentRouteDefinition = null;
3419
- SubformMagicService.currentCallerMgSubformServiceRef = null;
3420
- var ignoreParamChange_1 = true;
3421
- myActiveRoute_1.paramMap.subscribe(function (params) {
3422
- if (!ignoreParamChange_1)
3423
- _this.insertRouteEvent(myActiveRoute_1);
3424
- ignoreParamChange_1 = false;
3425
- });
3426
- this.parentMgSubformService.refreshView();
3427
- this.routerCommandsMagicService.ExecuteNextCommand();
3428
- }
3429
- };
3430
- RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
3431
- if (this.componentRef != null) {
3432
- this.componentRef.instance.task.close();
3433
- var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
3434
- this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
3435
- }
3436
- };
3437
- return RouterContainerMagicComponent;
3438
- }());
3439
- RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
3440
- RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
3441
- (function () {
3442
- i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
3443
- type: i0.Component,
3444
- args: [{
3445
- selector: 'magic-route-outlet',
3446
- template: "\n "
3447
- }]
3448
- }], function () { return [{ type: i2.ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
3449
- })();
3450
-
3451
3506
  var Constants = /** @class */ (function () {
3452
3507
  function Constants() {
3453
3508
  }