@magic-xpa/angular 4.1100.0-dev4110.106 → 4.1100.0-dev4110.108

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.
Files changed (124) hide show
  1. package/README.md +5 -5
  2. package/esm2020/index.mjs +59 -2
  3. package/esm2020/src/controls.metadata.model.mjs +180 -0
  4. package/esm2020/src/interfaces/sub-form-definition.iterface.mjs +2 -0
  5. package/esm2020/src/magic.core.module.mjs +160 -0
  6. package/esm2020/src/services/ISubformMagicService.mjs +2 -0
  7. package/esm2020/src/services/OverlayWindowService.mjs +236 -0
  8. package/esm2020/src/services/StylesMapManager.mjs +28 -0
  9. package/esm2020/src/services/accessor.magic.service.mjs +356 -0
  10. package/esm2020/src/services/commands-collector.magic.service.mjs +46 -0
  11. package/esm2020/src/services/component-list.magic.service.mjs +46 -0
  12. package/esm2020/src/services/confirmation.components.magic.provider.mjs +21 -0
  13. package/esm2020/src/services/engine.magic.service.mjs +82 -0
  14. package/esm2020/src/services/exit.magic.service.mjs +13 -0
  15. package/esm2020/src/services/magic-color.service.mjs +99 -0
  16. package/esm2020/src/services/magic.lazy.loader.service.mjs +16 -0
  17. package/esm2020/src/services/magic.providers.mjs +25 -0
  18. package/esm2020/src/services/magic.services.mjs +31 -0
  19. package/esm2020/src/services/mg-date-adapter.mjs +109 -0
  20. package/esm2020/src/services/overlay.conainer.magic.provider.mjs +14 -0
  21. package/esm2020/src/services/router-commands.magic.service.mjs +28 -0
  22. package/esm2020/src/services/subform.magic.service.mjs +184 -0
  23. package/esm2020/src/services/table.magic.service.mjs +77 -0
  24. package/esm2020/src/services/task.magics.service.mjs +624 -0
  25. package/esm2020/src/services/title.magic.service.mjs +18 -0
  26. package/esm2020/src/ui/GuiInteractiveExecutor.mjs +105 -0
  27. package/esm2020/src/ui/components/base-magic-alert.component.mjs +23 -0
  28. package/esm2020/src/ui/components/base-magic-confirm.component.mjs +23 -0
  29. package/esm2020/src/ui/components/magic-alert.component.mjs +35 -0
  30. package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +41 -0
  31. package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +49 -0
  32. package/esm2020/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +28 -0
  33. package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +28 -0
  34. package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +36 -0
  35. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +27 -0
  36. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +52 -0
  37. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +32 -0
  38. package/esm2020/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +27 -0
  39. package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +193 -0
  40. package/esm2020/src/ui/directives/magic/row.magic.directive.mjs +58 -0
  41. package/esm2020/src/ui/directives/magic-focus.directive.mjs +19 -0
  42. package/esm2020/src/ui/directives/magic.directive.mjs +215 -0
  43. package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +19 -0
  44. package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +408 -0
  45. package/esm2020/src/ui/directives/range-validator.magic.directive.mjs +58 -0
  46. package/esm2020/src/ui/magic-confirmationBox.mjs +42 -0
  47. package/esm2020/src/ui/magic-modal/base-magic-overlay-container.mjs +22 -0
  48. package/esm2020/src/ui/magic-modal/magic-modal-form.mjs +8 -0
  49. package/esm2020/src/ui/magic-modal/magic-modal-interface.mjs +2 -0
  50. package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +121 -0
  51. package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +159 -0
  52. package/esm2020/src/ui/magic-root.component.mjs +203 -0
  53. package/esm2020/src/ui/mgerror.magic.component.mjs +119 -0
  54. package/esm2020/src/ui/pipes/date.magic.pipe.mjs +105 -0
  55. package/esm2020/src/ui/pipes/time.magic.pipe.mjs +51 -0
  56. package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +34 -0
  57. package/esm2020/src/ui/router-container.magic.component.mjs +108 -0
  58. package/esm2020/src/ui/subform.magic.component.mjs +52 -0
  59. package/esm2020/src/ui/task-base.magic.component.mjs +86 -0
  60. package/esm2020/src/ui/utils.mjs +54 -0
  61. package/fesm2015/magic-xpa-angular.mjs +4863 -0
  62. package/fesm2015/magic-xpa-angular.mjs.map +1 -1
  63. package/fesm2020/magic-xpa-angular.mjs +4681 -0
  64. package/fesm2020/magic-xpa-angular.mjs.map +1 -1
  65. package/index.d.ts +58 -1
  66. package/package.json +3 -3
  67. package/src/controls.metadata.model.d.ts +62 -0
  68. package/src/interfaces/sub-form-definition.iterface.d.ts +12 -0
  69. package/src/magic.core.module.d.ts +41 -0
  70. package/src/services/ISubformMagicService.d.ts +4 -0
  71. package/src/services/OverlayWindowService.d.ts +31 -0
  72. package/src/services/StylesMapManager.d.ts +5 -0
  73. package/src/services/accessor.magic.service.d.ts +69 -0
  74. package/src/services/commands-collector.magic.service.d.ts +15 -0
  75. package/src/services/component-list.magic.service.d.ts +23 -0
  76. package/src/services/confirmation.components.magic.provider.d.ts +8 -0
  77. package/src/services/engine.magic.service.d.ts +27 -0
  78. package/src/services/exit.magic.service.d.ts +6 -0
  79. package/src/services/magic-color.service.d.ts +19 -0
  80. package/src/services/magic.lazy.loader.service.d.ts +6 -0
  81. package/src/services/magic.providers.d.ts +107 -0
  82. package/src/services/magic.services.d.ts +16 -0
  83. package/src/services/mg-date-adapter.d.ts +40 -0
  84. package/src/services/overlay.conainer.magic.provider.d.ts +7 -0
  85. package/src/services/router-commands.magic.service.d.ts +17 -0
  86. package/src/services/subform.magic.service.d.ts +43 -0
  87. package/src/services/table.magic.service.d.ts +30 -0
  88. package/src/services/task.magics.service.d.ts +100 -0
  89. package/src/services/title.magic.service.d.ts +9 -0
  90. package/src/ui/GuiInteractiveExecutor.d.ts +22 -0
  91. package/src/ui/components/base-magic-alert.component.d.ts +10 -0
  92. package/src/ui/components/base-magic-confirm.component.d.ts +10 -0
  93. package/src/ui/components/magic-alert.component.d.ts +6 -0
  94. package/src/ui/components/magic-confirmation-box.component.d.ts +6 -0
  95. package/src/ui/directives/NonMagicControlDirective.d.ts +26 -0
  96. package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +9 -0
  97. package/src/ui/directives/magic/checkbox.magic.directive.d.ts +9 -0
  98. package/src/ui/directives/magic/combobox.magic.directive.d.ts +10 -0
  99. package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +7 -0
  100. package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +17 -0
  101. package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +7 -0
  102. package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +9 -0
  103. package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +18 -0
  104. package/src/ui/directives/magic/row.magic.directive.d.ts +17 -0
  105. package/src/ui/directives/magic-focus.directive.d.ts +9 -0
  106. package/src/ui/directives/magic.directive.d.ts +44 -0
  107. package/src/ui/directives/magicViewContainerRef.directive.d.ts +8 -0
  108. package/src/ui/directives/mgformat.magic.directive.d.ts +31 -0
  109. package/src/ui/directives/range-validator.magic.directive.d.ts +17 -0
  110. package/src/ui/magic-confirmationBox.d.ts +6 -0
  111. package/src/ui/magic-modal/base-magic-overlay-container.d.ts +5 -0
  112. package/src/ui/magic-modal/magic-modal-form.d.ts +5 -0
  113. package/src/ui/magic-modal/magic-modal-interface.d.ts +10 -0
  114. package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +31 -0
  115. package/src/ui/magic-modal/magic-overlay-container.d.ts +25 -0
  116. package/src/ui/magic-root.component.d.ts +40 -0
  117. package/src/ui/mgerror.magic.component.d.ts +20 -0
  118. package/src/ui/pipes/date.magic.pipe.d.ts +17 -0
  119. package/src/ui/pipes/time.magic.pipe.d.ts +11 -0
  120. package/src/ui/pipes/time24.magic.pipe.d.ts +10 -0
  121. package/src/ui/router-container.magic.component.d.ts +30 -0
  122. package/src/ui/subform.magic.component.d.ts +16 -0
  123. package/src/ui/task-base.magic.component.d.ts +34 -0
  124. package/src/ui/utils.d.ts +9 -0
@@ -0,0 +1,108 @@
1
+ import { Component, ComponentFactoryResolver, ViewContainerRef } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { EngineMagicService } from '../services/engine.magic.service';
4
+ import { getGuiEventObj } from '@magic-xpa/engine';
5
+ import { List } from '@magic-xpa/mscorelib';
6
+ import { StrUtil } from '@magic-xpa/utils';
7
+ import { ComponentListMagicService } from '../services/component-list.magic.service';
8
+ import { SubformMagicService } from '../services/subform.magic.service';
9
+ import { CommandsCollectorMagicService } from '../services/commands-collector.magic.service';
10
+ import { RouterCommandsMagicService } from '../services/router-commands.magic.service';
11
+ import { TaskMagicService } from '../services/task.magics.service';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "@angular/router";
14
+ import * as i2 from "../services/engine.magic.service";
15
+ import * as i3 from "../services/task.magics.service";
16
+ import * as i4 from "../services/component-list.magic.service";
17
+ import * as i5 from "../services/commands-collector.magic.service";
18
+ import * as i6 from "../services/router-commands.magic.service";
19
+ export class RouterContainerMagicComponent {
20
+ static get LastRoute() {
21
+ return RouterContainerMagicComponent.lastRoute;
22
+ }
23
+ constructor(activatedRoute, router, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
24
+ this.activatedRoute = activatedRoute;
25
+ this.router = router;
26
+ this.magic = magic;
27
+ this.containerTaskService = containerTaskService;
28
+ this.componentFactoryResolver = componentFactoryResolver;
29
+ this.viewContainerRef = viewContainerRef;
30
+ this.componentList = componentList;
31
+ this.pendingCommandsCollector = pendingCommandsCollector;
32
+ this.routerCommandsMagicService = routerCommandsMagicService;
33
+ this.componentRef = null;
34
+ this.parentMgSubformService = null;
35
+ }
36
+ ngOnInit() {
37
+ let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
38
+ let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
39
+ RouterContainerMagicComponent.lastRoute = this.router.url;
40
+ if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
41
+ this.insertRouteEvent(currentActiveRoute);
42
+ SubformMagicService.routerContainers.push(this);
43
+ }
44
+ else {
45
+ this.initializeComponent();
46
+ }
47
+ }
48
+ insertRouteEvent(currentActiveRoute) {
49
+ let guiEvent = getGuiEventObj('RouterNavigate', null, 0);
50
+ guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
51
+ if (currentActiveRoute.snapshot.outlet !== 'primary')
52
+ guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
53
+ let calcRouterPath = currentActiveRoute.routeConfig.path;
54
+ if (calcRouterPath.length > 0) {
55
+ let routerPath = calcRouterPath;
56
+ let tokens = StrUtil.tokenize(routerPath, "/:");
57
+ guiEvent.RouterPath = tokens[0];
58
+ guiEvent.RouterParams = new List();
59
+ for (let i = 1; i < tokens.length; i++) {
60
+ guiEvent.RouterParams.push(currentActiveRoute.snapshot.params[tokens[i]]);
61
+ }
62
+ }
63
+ this.containerTaskService.insertEvent(guiEvent);
64
+ }
65
+ initializeComponent() {
66
+ let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
67
+ if (subformMagicService.currentRouteDefinition !== null) {
68
+ let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
69
+ const componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
70
+ this.componentRef = this.viewContainerRef.createComponent(componentFactory);
71
+ Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
72
+ let myActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
73
+ let routeParams = StrUtil.tokenize(myActiveRoute.snapshot.routeConfig.path, "/:");
74
+ subformMagicService.routesDict[myActiveRoute.snapshot.outlet] = routeParams[0];
75
+ this.parentMgSubformService = subformMagicService;
76
+ subformMagicService.currentRouteDefinition = null;
77
+ SubformMagicService.currentCallerMgSubformServiceRef = null;
78
+ let ignoreParamChange = true;
79
+ myActiveRoute.paramMap.subscribe(params => {
80
+ if (!ignoreParamChange)
81
+ this.insertRouteEvent(myActiveRoute);
82
+ ignoreParamChange = false;
83
+ });
84
+ this.parentMgSubformService.refreshView();
85
+ this.routerCommandsMagicService.ExecuteNextCommand();
86
+ }
87
+ }
88
+ ngOnDestroy() {
89
+ if (this.componentRef != null) {
90
+ this.componentRef.instance.task.close();
91
+ let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
92
+ this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
93
+ RouterContainerMagicComponent.lastRoute = this.router.url;
94
+ }
95
+ }
96
+ }
97
+ RouterContainerMagicComponent.lastRoute = "/";
98
+ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i1.ActivatedRoute), i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i2.EngineMagicService), i0.ɵɵdirectiveInject(i3.TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i4.ComponentListMagicService), i0.ɵɵdirectiveInject(i5.CommandsCollectorMagicService), i0.ɵɵdirectiveInject(i6.RouterCommandsMagicService)); };
99
+ RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
100
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
101
+ type: Component,
102
+ args: [{
103
+ selector: 'magic-route-outlet',
104
+ template: `
105
+ `
106
+ }]
107
+ }], function () { return [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: i2.EngineMagicService }, { type: i3.TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: i4.ComponentListMagicService }, { type: i5.CommandsCollectorMagicService }, { type: i6.RouterCommandsMagicService }]; }, null); })();
108
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLWNvbnRhaW5lci5tYWdpYy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS9yb3V0ZXItY29udGFpbmVyLm1hZ2ljLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLHdCQUF3QixFQUFVLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzlGLE9BQU8sRUFBQyxjQUFjLEVBQUUsTUFBTSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFFdkQsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDdEUsT0FBTyxFQUFFLGNBQWMsRUFBYSxNQUFNLG1CQUFtQixDQUFDO0FBQzlELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM1QyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDM0MsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFDckYsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDeEUsT0FBTyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sOENBQThDLENBQUM7QUFDN0YsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sMkNBQTJ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b25lbnRSZWYuaW5zdGFuY2UpLnRhc2suY2xvc2UoKTtcclxuXHJcbiAgICAgIGxldCBjdXJyZW50QWN0aXZlUm91dGUgPSBTdWJmb3JtTWFnaWNTZXJ2aWNlLmdldFJlbGF0aXZlUm91dGUodGhpcy5hY3RpdmF0ZWRSb3V0ZSk7XHJcbiAgICAgIHRoaXMucGFyZW50TWdTdWJmb3JtU2VydmljZS5yb3V0ZXNEaWN0W2N1cnJlbnRBY3RpdmVSb3V0ZS5vdXRsZXRdID0gXCJcIjtcclxuXHJcbiAgICAgIFJvdXRlckNvbnRhaW5lck1hZ2ljQ29tcG9uZW50Lmxhc3RSb3V0ZSA9IHRoaXMucm91dGVyLnVybDtcclxuICAgIH1cclxuICB9XHJcblxyXG59XHJcbiJdfQ==
@@ -0,0 +1,52 @@
1
+ import { Component, Input, ViewContainerRef } from "@angular/core";
2
+ import { SubformMagicService } from "../services/subform.magic.service";
3
+ import { isNullOrUndefined } from '@magic-xpa/mscorelib';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "../services/subform.magic.service";
6
+ import * as i2 from "@angular/common";
7
+ import * as i3 from "ng-dynamic-component";
8
+ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
9
+ i0.ɵɵelement(0, "ndc-dynamic", 1);
10
+ } if (rf & 2) {
11
+ const ctx_r0 = i0.ɵɵnextContext();
12
+ i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
13
+ } }
14
+ export class SubformMagicComponent {
15
+ set magic(val) { this.id = val; }
16
+ ;
17
+ constructor(vcRef, mgSub) {
18
+ this.vcRef = vcRef;
19
+ this.mgSub = mgSub;
20
+ this.component = null;
21
+ this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
22
+ }
23
+ get Component() {
24
+ return this.mgSub.mgGetComp(this.id);
25
+ }
26
+ get Parameters() {
27
+ return this.mgSub.mgGetParameters(this.id);
28
+ }
29
+ }
30
+ SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i1.SubformMagicService)); };
31
+ SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) { if (rf & 1) {
32
+ i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
33
+ } if (rf & 2) {
34
+ i0.ɵɵproperty("ngIf", ctx.Component);
35
+ } }, dependencies: [i2.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
36
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicComponent, [{
37
+ type: Component,
38
+ args: [{
39
+ selector: 'magic-subform',
40
+ template: `
41
+ <ndc-dynamic
42
+ *ngIf="Component"
43
+ [ndcDynamicComponent]="Component"
44
+ [ndcDynamicInputs]="Parameters">
45
+ </ndc-dynamic>
46
+ `
47
+ }]
48
+ }], function () { return [{ type: i0.ViewContainerRef }, { type: i1.SubformMagicService }]; }, { magic: [{
49
+ type: Input,
50
+ args: ['magic']
51
+ }] }); })();
52
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ViZm9ybS5tYWdpYy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS9zdWJmb3JtLm1hZ2ljLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0F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bm9yZVxyXG4gICAqL1xyXG4gIEBJbnB1dCgnbWFnaWMnKSBzZXQgbWFnaWModmFsKSB7dGhpcy5pZCA9IHZhbDsgfTtcclxuXHJcbiAgLyoqXHJcbiAgICogQGlnbm9yZVxyXG4gICAqL1xyXG4gIGNvbXBvbmVudDogVGFza0Jhc2VNYWdpY0NvbXBvbmVudCA9IG51bGw7XHJcblxyXG4gIC8qKlxyXG4gICAqIEBpZ25vcmVcclxuICAgKi9cclxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHZjUmVmOiBWaWV3Q29udGFpbmVyUmVmLCBwcm90ZWN0ZWQgbWdTdWI6IFN1YmZvcm1NYWdpY1NlcnZpY2UpIHtcclxuICAgIC8vIEZvciBhbmd1bGFyIDEzIC0gZmluZCB0aGUgY29tcG9uZW50IGZyb20gX2hvc3RMVmlld1xyXG4gICAgdGhpcy5jb21wb25lbnQgPSAgICgoPGFueT50aGlzLnZjUmVmKS5faG9zdExWaWV3KS5maW5kKHYgPT4gIWlzTnVsbE9yVW5kZWZpbmVkKCh2IGFzIFRhc2tCYXNlTWFnaWNDb21wb25lbnQpKSk7XHJcbiAgfVxyXG5cclxuICAvKipcclxuICAgKiBAaWdub3JlXHJcbiAgICovXHJcbiAgZ2V0IENvbXBvbmVudCgpOiBDb21wb25lbnQge1xyXG4gICAgcmV0dXJuIHRoaXMubWdTdWIubWdHZXRDb21wKHRoaXMuaWQpO1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogQGlnbm9yZVxyXG4gICAqL1xyXG4gIGdldCBQYXJhbWV0ZXJzKCk6IGFueSB7XHJcbiAgICByZXR1cm4gdGhpcy5tZ1N1Yi5tZ0dldFBhcmFtZXRlcnModGhpcy5pZCk7XHJcbiAgfVxyXG59XHJcblxyXG4iXX0=
@@ -0,0 +1,86 @@
1
+ import { ChangeDetectorRef, Component, Input } from '@angular/core';
2
+ import { MagicProperties } from "@magic-xpa/utils";
3
+ import { isNullOrUndefined } from "@magic-xpa/mscorelib";
4
+ import { TaskMagicService } from "../services/task.magics.service";
5
+ import { SubformMagicService } from "../services/subform.magic.service";
6
+ import { TableMagicService } from "../services/table.magic.service";
7
+ import { MagicServices } from "../services/magic.services";
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "../services/magic.services";
10
+ export class TaskBaseMagicComponent {
11
+ constructor(ref, magicServices) {
12
+ this.ref = ref;
13
+ this.magicServices = magicServices;
14
+ this.magicProperties = MagicProperties;
15
+ }
16
+ get task() {
17
+ return this.magicServices.task;
18
+ }
19
+ get mgSub() {
20
+ return this.magicServices.subformService;
21
+ }
22
+ get tableService() {
23
+ return this.magicServices.tableService;
24
+ }
25
+ get mg() {
26
+ return this.magicServices.mgAccessorService;
27
+ }
28
+ get taskId() {
29
+ return this.task.taskId;
30
+ }
31
+ get screenFormGroup() {
32
+ return this.task.ScreenModeControls;
33
+ }
34
+ ngOnInit() {
35
+ this.task.detectChanges.pipe().subscribe(c => {
36
+ this.ref.detectChanges();
37
+ });
38
+ this.task.initTask(this.taskIdParam, this.taskDescription);
39
+ this.createFormControlsAccessor(this.screenFormGroup);
40
+ this.setInputDateFormat();
41
+ this.task.customPropertiesSubject.pipe().subscribe(property => {
42
+ this.PropertyChanged(property.propertyName, property.rowId, property.value);
43
+ });
44
+ this.task.recordsCountChangeSubject.pipe().subscribe(value => {
45
+ this.RecordsCountChanged(value);
46
+ });
47
+ this.task.mgLoadSubject.pipe().subscribe(value => {
48
+ this.mgOnLoad();
49
+ });
50
+ }
51
+ createFormControlsAccessor(formGroup) { }
52
+ setInputDateFormat() { }
53
+ PropertyChanged(propertyName, rowId, value) {
54
+ }
55
+ RecordsCountChanged(recordsCount) {
56
+ }
57
+ mgOnLoad() {
58
+ }
59
+ ngAfterViewInit() {
60
+ this.mgSub.init();
61
+ }
62
+ ngAfterContentChecked() {
63
+ if (!isNullOrUndefined(this.tableService.getPageSize()) && this.task.oldPageSize != this.tableService.getPageSize()) {
64
+ this.task.resize(this.tableService.getPageSize(), 0);
65
+ this.task.oldPageSize = this.tableService.getPageSize();
66
+ }
67
+ }
68
+ ngOnDestroy() {
69
+ this.task.dispose();
70
+ }
71
+ }
72
+ TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MagicServices)); };
73
+ TaskBaseMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
74
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
75
+ type: Component,
76
+ args: [{
77
+ selector: 'task-magic',
78
+ providers: [TaskMagicService, SubformMagicService, TableMagicService],
79
+ template: ''
80
+ }]
81
+ }], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.MagicServices }]; }, { taskIdParam: [{
82
+ type: Input
83
+ }], taskDescription: [{
84
+ type: Input
85
+ }] }); })();
86
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFzay1iYXNlLm1hZ2ljLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXIvc3JjL3VpL3Rhc2stYmFzZS5tYWdpYy5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFnQixpQkFBaUIsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFvQixNQUFNLGVBQWUsQ0FBQztBQUVwRyxPQUFPLEVBQUUsZUFBZSxFQUFDLE1BQU0sa0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2UoKTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==
@@ -0,0 +1,54 @@
1
+ export class utils {
2
+ static getDistance(control, x, y) {
3
+ let left = control.clientLeft, top = control.clientTop;
4
+ let dx, dy;
5
+ const right = left + control.clientWidth;
6
+ const bottom = top + control.clientHeight;
7
+ if (x < left) {
8
+ dx = left - x;
9
+ }
10
+ else if (x > right) {
11
+ dx = x - right;
12
+ }
13
+ else {
14
+ dx = 0;
15
+ }
16
+ if (y < top) {
17
+ dy = top - y;
18
+ }
19
+ else if (y > bottom) {
20
+ dy = y - bottom;
21
+ }
22
+ else {
23
+ dy = 0;
24
+ }
25
+ const ret = (dx * dx + dy * dy);
26
+ return ret;
27
+ }
28
+ static getDimentions(el) {
29
+ let xPos = 0;
30
+ let yPos = 0;
31
+ let width = el.width;
32
+ let height = el.height;
33
+ while (el) {
34
+ if (el.tagName == "BODY") {
35
+ let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
36
+ let yScroll = el.scrollTop || document.documentElement.scrollTop;
37
+ xPos += (el.offsetLeft - xScroll + el.clientLeft);
38
+ yPos += (el.offsetTop - yScroll + el.clientTop);
39
+ }
40
+ else {
41
+ xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
42
+ yPos += (el.offsetTop - el.scrollTop + el.clientTop);
43
+ }
44
+ el = el.offsetParent;
45
+ }
46
+ return {
47
+ x: xPos,
48
+ y: yPos,
49
+ width: width,
50
+ height: height
51
+ };
52
+ }
53
+ }
54
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxNQUFNLE9BQU8sS0FBSztJQUtoQixNQUFNLENBQUMsV0FBVyxDQUFDLE9BQWdCLEVB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