@magic-xpa/angular 4.800.0-dev480.188 → 4.800.0-dev480.196
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.
- package/bundles/magic-xpa-angular.umd.js +436 -419
- package/bundles/magic-xpa-angular.umd.js.map +1 -1
- package/bundles/magic-xpa-angular.umd.min.js +1 -1
- package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
- package/esm2015/src/ui/GuiInteractiveExecutor.js +8 -1
- package/esm2015/src/ui/router-container.magic.component.js +12 -5
- package/fesm2015/magic-xpa-angular.js +423 -410
- package/fesm2015/magic-xpa-angular.js.map +1 -1
- package/package.json +3 -3
- package/src/ui/GuiInteractiveExecutor.d.ts +1 -0
- package/src/ui/router-container.magic.component.d.ts +5 -2
|
@@ -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
|
|
|
@@ -2044,355 +2393,110 @@
|
|
|
2044
2393
|
if (!util.isNullOrUndefined(event.target)) {
|
|
2045
2394
|
var indexes = new Array(event.target.selectedOptions.length);
|
|
2046
2395
|
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, componentListMagicService, loader, injector) {
|
|
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.componentListMagicService = componentListMagicService;
|
|
2232
|
-
this.loader = loader;
|
|
2233
|
-
this.injector = injector;
|
|
2234
|
-
this.subformsDict = {};
|
|
2235
|
-
this.routesDict = {};
|
|
2236
|
-
this.currentRouteDefinition = null;
|
|
2237
|
-
}
|
|
2238
|
-
SubformMagicService.prototype.mgGetComp = function (subformName) {
|
|
2239
|
-
if (subformName in this.subformsDict) {
|
|
2240
|
-
var formName = this.subformsDict[subformName].formName;
|
|
2241
|
-
if (formName)
|
|
2242
|
-
return this.componentList.getComponent(formName);
|
|
2243
|
-
}
|
|
2244
|
-
return null;
|
|
2245
|
-
};
|
|
2246
|
-
SubformMagicService.prototype.mgGetParameters = function (subformName) {
|
|
2247
|
-
if (subformName in this.subformsDict) {
|
|
2248
|
-
return this.subformsDict[subformName].parameters;
|
|
2249
|
-
}
|
|
2250
|
-
else
|
|
2251
|
-
return "";
|
|
2252
|
-
};
|
|
2253
|
-
SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
|
|
2254
|
-
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2255
|
-
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2256
|
-
this.subformsDict[subformControlName] = {};
|
|
2257
|
-
this.task.refreshView();
|
|
2258
|
-
}
|
|
2259
|
-
}
|
|
2260
|
-
};
|
|
2261
|
-
SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
|
2262
|
-
var _this = this;
|
|
2263
|
-
this.pendingCommandsCollector.startCollecting();
|
|
2264
|
-
var refreshNeeded = false;
|
|
2265
|
-
if (util.isNullOrUndefined(routerPath)) {
|
|
2266
|
-
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2267
|
-
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2268
|
-
this.subformsDict[subformControlName] = {};
|
|
2269
|
-
this.task.refreshView();
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
var moduleRef_1 = this.componentListMagicService.getModuleRef(formName);
|
|
2273
|
-
if (moduleRef_1 == null) {
|
|
2274
|
-
var lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
|
2275
|
-
if (lazyLoadModule != null) {
|
|
2276
|
-
this.loader
|
|
2277
|
-
.load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
|
|
2278
|
-
.then(function (moduleFactory) {
|
|
2279
|
-
moduleRef_1 = moduleFactory.create(_this.injector);
|
|
2280
|
-
_this.subformsDict[subformControlName] = {
|
|
2281
|
-
formName: formName,
|
|
2282
|
-
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2283
|
-
};
|
|
2284
|
-
_this.task.refreshView();
|
|
2285
|
-
});
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
else {
|
|
2289
|
-
this.subformsDict[subformControlName] = {
|
|
2290
|
-
formName: formName,
|
|
2291
|
-
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2292
|
-
};
|
|
2293
|
-
refreshNeeded = true;
|
|
2396
|
+
indexes[i] = event.target.selectedOptions[i].index;
|
|
2397
|
+
}
|
|
2398
|
+
guiEvent.Value = indexes.join(',');
|
|
2294
2399
|
}
|
|
2400
|
+
else
|
|
2401
|
+
guiEvent.Value = event.value;
|
|
2295
2402
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
};
|
|
2311
|
-
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
2312
|
-
this.ExecuteRouteCommand(routeCommand);
|
|
2403
|
+
this.insertEvent(guiEvent);
|
|
2404
|
+
};
|
|
2405
|
+
TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
|
|
2406
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2407
|
+
var selectedOptions;
|
|
2408
|
+
if (!util.isNullOrUndefined(event.target))
|
|
2409
|
+
selectedOptions = event.target.selectedOptions;
|
|
2410
|
+
else
|
|
2411
|
+
selectedOptions = event.source.selectedOptions.selected;
|
|
2412
|
+
var length = selectedOptions.length;
|
|
2413
|
+
var indexes = new Array(length);
|
|
2414
|
+
for (var i = 0; i < length; i++) {
|
|
2415
|
+
if (!util.isNullOrUndefined(event.target))
|
|
2416
|
+
indexes[i] = (selectedOptions[i]).index;
|
|
2313
2417
|
else
|
|
2314
|
-
|
|
2418
|
+
indexes[i] = (selectedOptions[i]).value;
|
|
2315
2419
|
}
|
|
2316
|
-
|
|
2317
|
-
|
|
2420
|
+
guiEvent.Value = indexes;
|
|
2421
|
+
this.insertEvent(guiEvent);
|
|
2318
2422
|
};
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
var
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
|
|
2326
|
-
.then(function (result) {
|
|
2327
|
-
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
2328
|
-
currentSubformMagicService.currentRouteDefinition = {
|
|
2329
|
-
formName: routeCommand.formName,
|
|
2330
|
-
parameters: routeCommand.parameters
|
|
2331
|
-
};
|
|
2332
|
-
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
2333
|
-
});
|
|
2423
|
+
TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
|
|
2424
|
+
if (typeof rowId === 'undefined')
|
|
2425
|
+
rowId = 0;
|
|
2426
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, rowId);
|
|
2427
|
+
if (typeof (event) == 'boolean') {
|
|
2428
|
+
guiEvent.Value = event;
|
|
2334
2429
|
}
|
|
2335
2430
|
else {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
};
|
|
2341
|
-
if (SubformMagicService.routerContainers.length > 0) {
|
|
2342
|
-
var routeContainer = SubformMagicService.routerContainers[0];
|
|
2343
|
-
SubformMagicService.routerContainers.shift();
|
|
2344
|
-
routeContainer.initializeComponent();
|
|
2345
|
-
}
|
|
2346
|
-
else {
|
|
2347
|
-
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
2348
|
-
}
|
|
2431
|
+
if (typeof event.target === 'undefined')
|
|
2432
|
+
guiEvent.Value = (event).checked;
|
|
2433
|
+
else
|
|
2434
|
+
guiEvent.Value = (event.target).checked;
|
|
2349
2435
|
}
|
|
2436
|
+
this.insertEvent(guiEvent);
|
|
2350
2437
|
};
|
|
2351
|
-
|
|
2352
|
-
var
|
|
2353
|
-
|
|
2354
|
-
this.
|
|
2355
|
-
.then(function (result) {
|
|
2356
|
-
if (result !== null && !result) {
|
|
2357
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
2358
|
-
subformMagicService.currentRouteDefinition = null;
|
|
2359
|
-
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
2360
|
-
subformMagicService.pendingCommandsCollector.stopCollecting();
|
|
2361
|
-
subformMagicService.routerCommandsMagicService.ExecuteNextCommand();
|
|
2362
|
-
}
|
|
2363
|
-
});
|
|
2438
|
+
TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
|
|
2439
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2440
|
+
guiEvent.Value = layer.toString();
|
|
2441
|
+
this.insertEvent(guiEvent);
|
|
2364
2442
|
};
|
|
2365
|
-
|
|
2366
|
-
var
|
|
2367
|
-
var
|
|
2368
|
-
if (
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
this.
|
|
2443
|
+
TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
|
|
2444
|
+
var result = this.getFormControl('0', idx);
|
|
2445
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2446
|
+
if (typeof result.value !== 'string')
|
|
2447
|
+
guiEvent.Value = result.value.index;
|
|
2448
|
+
else
|
|
2449
|
+
guiEvent.Value = result.value;
|
|
2450
|
+
this.insertEvent(guiEvent);
|
|
2373
2451
|
};
|
|
2374
|
-
|
|
2375
|
-
this.
|
|
2452
|
+
TaskMagicService.prototype.close = function () {
|
|
2453
|
+
this.insertEvent(engine.getGuiEventObj('close', null, 0));
|
|
2376
2454
|
};
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2455
|
+
TaskMagicService.prototype.IsStub = function () {
|
|
2456
|
+
return this.magic.isStub;
|
|
2457
|
+
};
|
|
2458
|
+
TaskMagicService.prototype.saveData = function (data) {
|
|
2459
|
+
this.magic.saveData(data);
|
|
2460
|
+
};
|
|
2461
|
+
TaskMagicService.prototype.createData = function () {
|
|
2462
|
+
var myData = {
|
|
2463
|
+
records: this.Records,
|
|
2464
|
+
template: this.template
|
|
2465
|
+
};
|
|
2466
|
+
var text = 'loadData():any {\n' +
|
|
2467
|
+
' let stubData = ' + JSON.stringify(myData) + ';\n' +
|
|
2468
|
+
' this.loadStubData(stubData);}';
|
|
2469
|
+
console.log(text);
|
|
2470
|
+
this.saveData(text);
|
|
2471
|
+
};
|
|
2472
|
+
TaskMagicService.prototype.loadStubData = function (stubData) {
|
|
2473
|
+
this.Records = stubData.records;
|
|
2474
|
+
this.settemplate(stubData.template);
|
|
2475
|
+
this.taskId = '1';
|
|
2476
|
+
for (var i = 0; i < this.Records.list.length; i++)
|
|
2477
|
+
this.buildTableRowControls(i);
|
|
2478
|
+
};
|
|
2479
|
+
TaskMagicService.prototype.loadData = function () {
|
|
2480
|
+
alert('Please, overwrite method loadData');
|
|
2481
|
+
};
|
|
2482
|
+
TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
|
|
2483
|
+
if (this.IsStub()) {
|
|
2484
|
+
try {
|
|
2485
|
+
var val = this.Records.list[guiRowId].values[name];
|
|
2486
|
+
fc.setValue(val);
|
|
2487
|
+
}
|
|
2488
|
+
catch (e) {
|
|
2489
|
+
}
|
|
2383
2490
|
}
|
|
2384
|
-
return currentActiveRoute;
|
|
2385
2491
|
};
|
|
2386
|
-
return
|
|
2492
|
+
return TaskMagicService;
|
|
2387
2493
|
}());
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
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)); };
|
|
2391
|
-
SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
2494
|
+
TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
|
2495
|
+
TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
2392
2496
|
(function () {
|
|
2393
|
-
i0.ɵsetClassMetadata(
|
|
2497
|
+
i0.ɵsetClassMetadata(TaskMagicService, [{
|
|
2394
2498
|
type: i0.Injectable
|
|
2395
|
-
}], function () { return [{ type:
|
|
2499
|
+
}], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
|
|
2396
2500
|
})();
|
|
2397
2501
|
|
|
2398
2502
|
var TableMagicService = /** @class */ (function () {
|
|
@@ -3394,93 +3498,6 @@
|
|
|
3394
3498
|
}] });
|
|
3395
3499
|
})();
|
|
3396
3500
|
|
|
3397
|
-
var RouterContainerMagicComponent = /** @class */ (function () {
|
|
3398
|
-
function RouterContainerMagicComponent(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
3399
|
-
this.activatedRoute = activatedRoute;
|
|
3400
|
-
this.magic = magic;
|
|
3401
|
-
this.containerTaskService = containerTaskService;
|
|
3402
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
3403
|
-
this.viewContainerRef = viewContainerRef;
|
|
3404
|
-
this.componentList = componentList;
|
|
3405
|
-
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
3406
|
-
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
3407
|
-
this.componentRef = null;
|
|
3408
|
-
this.parentMgSubformService = null;
|
|
3409
|
-
}
|
|
3410
|
-
RouterContainerMagicComponent.prototype.ngOnInit = function () {
|
|
3411
|
-
var outletname = this.activatedRoute.outlet;
|
|
3412
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
3413
|
-
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
3414
|
-
if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
|
|
3415
|
-
this.insertRouteEvent(currentActiveRoute);
|
|
3416
|
-
SubformMagicService.routerContainers.push(this);
|
|
3417
|
-
}
|
|
3418
|
-
else {
|
|
3419
|
-
this.initializeComponent();
|
|
3420
|
-
}
|
|
3421
|
-
};
|
|
3422
|
-
RouterContainerMagicComponent.prototype.insertRouteEvent = function (currentActiveRoute) {
|
|
3423
|
-
var guiEvent = engine.getGuiEventObj('RouterNavigate', null, 0);
|
|
3424
|
-
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
3425
|
-
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
3426
|
-
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
|
3427
|
-
var calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
3428
|
-
if (calcRouterPath.length > 0) {
|
|
3429
|
-
var routerPath = calcRouterPath;
|
|
3430
|
-
var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
|
|
3431
|
-
guiEvent.RouterPath = tokens[0];
|
|
3432
|
-
guiEvent.RouterParams = new mscorelib.List();
|
|
3433
|
-
for (var i = 1; i < tokens.length; i++) {
|
|
3434
|
-
guiEvent.RouterParams.push(this.activatedRoute.snapshot.params[tokens[i]]);
|
|
3435
|
-
}
|
|
3436
|
-
}
|
|
3437
|
-
this.containerTaskService.insertEvent(guiEvent);
|
|
3438
|
-
};
|
|
3439
|
-
RouterContainerMagicComponent.prototype.initializeComponent = function () {
|
|
3440
|
-
var _this = this;
|
|
3441
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
3442
|
-
if (subformMagicService.currentRouteDefinition !== null) {
|
|
3443
|
-
var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
3444
|
-
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
|
|
3445
|
-
this.componentRef = this.viewContainerRef.createComponent(componentFactory);
|
|
3446
|
-
Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
|
|
3447
|
-
var myActiveRoute_1 = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
3448
|
-
var routeParams = utils$1.StrUtil.tokenize(myActiveRoute_1.snapshot.routeConfig.path, "/:");
|
|
3449
|
-
subformMagicService.routesDict[myActiveRoute_1.snapshot.outlet] = routeParams[0];
|
|
3450
|
-
this.parentMgSubformService = subformMagicService;
|
|
3451
|
-
subformMagicService.currentRouteDefinition = null;
|
|
3452
|
-
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
3453
|
-
var ignoreParamChange_1 = true;
|
|
3454
|
-
myActiveRoute_1.paramMap.subscribe(function (params) {
|
|
3455
|
-
if (!ignoreParamChange_1)
|
|
3456
|
-
_this.insertRouteEvent(myActiveRoute_1);
|
|
3457
|
-
ignoreParamChange_1 = false;
|
|
3458
|
-
});
|
|
3459
|
-
this.parentMgSubformService.refreshView();
|
|
3460
|
-
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
3461
|
-
}
|
|
3462
|
-
};
|
|
3463
|
-
RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
|
|
3464
|
-
if (this.componentRef != null) {
|
|
3465
|
-
this.componentRef.instance.task.close();
|
|
3466
|
-
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
3467
|
-
this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
|
|
3468
|
-
}
|
|
3469
|
-
};
|
|
3470
|
-
return RouterContainerMagicComponent;
|
|
3471
|
-
}());
|
|
3472
|
-
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)); };
|
|
3473
|
-
RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
3474
|
-
(function () {
|
|
3475
|
-
i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
3476
|
-
type: i0.Component,
|
|
3477
|
-
args: [{
|
|
3478
|
-
selector: 'magic-route-outlet',
|
|
3479
|
-
template: "\n "
|
|
3480
|
-
}]
|
|
3481
|
-
}], function () { return [{ type: i2.ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
|
|
3482
|
-
})();
|
|
3483
|
-
|
|
3484
3501
|
var Constants = /** @class */ (function () {
|
|
3485
3502
|
function Constants() {
|
|
3486
3503
|
}
|