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

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 (123) hide show
  1. package/esm2020/index.mjs +59 -2
  2. package/esm2020/src/controls.metadata.model.mjs +180 -0
  3. package/esm2020/src/interfaces/sub-form-definition.iterface.mjs +2 -0
  4. package/esm2020/src/magic.core.module.mjs +160 -0
  5. package/esm2020/src/services/ISubformMagicService.mjs +2 -0
  6. package/esm2020/src/services/OverlayWindowService.mjs +236 -0
  7. package/esm2020/src/services/StylesMapManager.mjs +28 -0
  8. package/esm2020/src/services/accessor.magic.service.mjs +356 -0
  9. package/esm2020/src/services/commands-collector.magic.service.mjs +46 -0
  10. package/esm2020/src/services/component-list.magic.service.mjs +46 -0
  11. package/esm2020/src/services/confirmation.components.magic.provider.mjs +21 -0
  12. package/esm2020/src/services/engine.magic.service.mjs +82 -0
  13. package/esm2020/src/services/exit.magic.service.mjs +13 -0
  14. package/esm2020/src/services/magic-color.service.mjs +99 -0
  15. package/esm2020/src/services/magic.lazy.loader.service.mjs +16 -0
  16. package/esm2020/src/services/magic.providers.mjs +25 -0
  17. package/esm2020/src/services/magic.services.mjs +31 -0
  18. package/esm2020/src/services/mg-date-adapter.mjs +109 -0
  19. package/esm2020/src/services/overlay.conainer.magic.provider.mjs +14 -0
  20. package/esm2020/src/services/router-commands.magic.service.mjs +28 -0
  21. package/esm2020/src/services/subform.magic.service.mjs +184 -0
  22. package/esm2020/src/services/table.magic.service.mjs +77 -0
  23. package/esm2020/src/services/task.magics.service.mjs +624 -0
  24. package/esm2020/src/services/title.magic.service.mjs +18 -0
  25. package/esm2020/src/ui/GuiInteractiveExecutor.mjs +105 -0
  26. package/esm2020/src/ui/components/base-magic-alert.component.mjs +23 -0
  27. package/esm2020/src/ui/components/base-magic-confirm.component.mjs +23 -0
  28. package/esm2020/src/ui/components/magic-alert.component.mjs +35 -0
  29. package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +41 -0
  30. package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +49 -0
  31. package/esm2020/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +28 -0
  32. package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +28 -0
  33. package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +36 -0
  34. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +27 -0
  35. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +52 -0
  36. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +32 -0
  37. package/esm2020/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +27 -0
  38. package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +193 -0
  39. package/esm2020/src/ui/directives/magic/row.magic.directive.mjs +58 -0
  40. package/esm2020/src/ui/directives/magic-focus.directive.mjs +19 -0
  41. package/esm2020/src/ui/directives/magic.directive.mjs +215 -0
  42. package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +19 -0
  43. package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +408 -0
  44. package/esm2020/src/ui/directives/range-validator.magic.directive.mjs +58 -0
  45. package/esm2020/src/ui/magic-confirmationBox.mjs +42 -0
  46. package/esm2020/src/ui/magic-modal/base-magic-overlay-container.mjs +22 -0
  47. package/esm2020/src/ui/magic-modal/magic-modal-form.mjs +8 -0
  48. package/esm2020/src/ui/magic-modal/magic-modal-interface.mjs +2 -0
  49. package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +121 -0
  50. package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +159 -0
  51. package/esm2020/src/ui/magic-root.component.mjs +203 -0
  52. package/esm2020/src/ui/mgerror.magic.component.mjs +119 -0
  53. package/esm2020/src/ui/pipes/date.magic.pipe.mjs +105 -0
  54. package/esm2020/src/ui/pipes/time.magic.pipe.mjs +51 -0
  55. package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +34 -0
  56. package/esm2020/src/ui/router-container.magic.component.mjs +108 -0
  57. package/esm2020/src/ui/subform.magic.component.mjs +52 -0
  58. package/esm2020/src/ui/task-base.magic.component.mjs +86 -0
  59. package/esm2020/src/ui/utils.mjs +54 -0
  60. package/fesm2015/magic-xpa-angular.mjs +4863 -0
  61. package/fesm2015/magic-xpa-angular.mjs.map +1 -1
  62. package/fesm2020/magic-xpa-angular.mjs +4681 -0
  63. package/fesm2020/magic-xpa-angular.mjs.map +1 -1
  64. package/index.d.ts +58 -1
  65. package/package.json +3 -3
  66. package/src/controls.metadata.model.d.ts +62 -0
  67. package/src/interfaces/sub-form-definition.iterface.d.ts +12 -0
  68. package/src/magic.core.module.d.ts +41 -0
  69. package/src/services/ISubformMagicService.d.ts +4 -0
  70. package/src/services/OverlayWindowService.d.ts +31 -0
  71. package/src/services/StylesMapManager.d.ts +5 -0
  72. package/src/services/accessor.magic.service.d.ts +69 -0
  73. package/src/services/commands-collector.magic.service.d.ts +15 -0
  74. package/src/services/component-list.magic.service.d.ts +23 -0
  75. package/src/services/confirmation.components.magic.provider.d.ts +8 -0
  76. package/src/services/engine.magic.service.d.ts +27 -0
  77. package/src/services/exit.magic.service.d.ts +6 -0
  78. package/src/services/magic-color.service.d.ts +19 -0
  79. package/src/services/magic.lazy.loader.service.d.ts +6 -0
  80. package/src/services/magic.providers.d.ts +107 -0
  81. package/src/services/magic.services.d.ts +16 -0
  82. package/src/services/mg-date-adapter.d.ts +40 -0
  83. package/src/services/overlay.conainer.magic.provider.d.ts +7 -0
  84. package/src/services/router-commands.magic.service.d.ts +17 -0
  85. package/src/services/subform.magic.service.d.ts +43 -0
  86. package/src/services/table.magic.service.d.ts +30 -0
  87. package/src/services/task.magics.service.d.ts +100 -0
  88. package/src/services/title.magic.service.d.ts +9 -0
  89. package/src/ui/GuiInteractiveExecutor.d.ts +22 -0
  90. package/src/ui/components/base-magic-alert.component.d.ts +10 -0
  91. package/src/ui/components/base-magic-confirm.component.d.ts +10 -0
  92. package/src/ui/components/magic-alert.component.d.ts +6 -0
  93. package/src/ui/components/magic-confirmation-box.component.d.ts +6 -0
  94. package/src/ui/directives/NonMagicControlDirective.d.ts +26 -0
  95. package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +9 -0
  96. package/src/ui/directives/magic/checkbox.magic.directive.d.ts +9 -0
  97. package/src/ui/directives/magic/combobox.magic.directive.d.ts +10 -0
  98. package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +7 -0
  99. package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +17 -0
  100. package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +7 -0
  101. package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +9 -0
  102. package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +18 -0
  103. package/src/ui/directives/magic/row.magic.directive.d.ts +17 -0
  104. package/src/ui/directives/magic-focus.directive.d.ts +9 -0
  105. package/src/ui/directives/magic.directive.d.ts +44 -0
  106. package/src/ui/directives/magicViewContainerRef.directive.d.ts +8 -0
  107. package/src/ui/directives/mgformat.magic.directive.d.ts +31 -0
  108. package/src/ui/directives/range-validator.magic.directive.d.ts +17 -0
  109. package/src/ui/magic-confirmationBox.d.ts +6 -0
  110. package/src/ui/magic-modal/base-magic-overlay-container.d.ts +5 -0
  111. package/src/ui/magic-modal/magic-modal-form.d.ts +5 -0
  112. package/src/ui/magic-modal/magic-modal-interface.d.ts +10 -0
  113. package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +31 -0
  114. package/src/ui/magic-modal/magic-overlay-container.d.ts +25 -0
  115. package/src/ui/magic-root.component.d.ts +40 -0
  116. package/src/ui/mgerror.magic.component.d.ts +20 -0
  117. package/src/ui/pipes/date.magic.pipe.d.ts +17 -0
  118. package/src/ui/pipes/time.magic.pipe.d.ts +11 -0
  119. package/src/ui/pipes/time24.magic.pipe.d.ts +10 -0
  120. package/src/ui/router-container.magic.component.d.ts +30 -0
  121. package/src/ui/subform.magic.component.d.ts +16 -0
  122. package/src/ui/task-base.magic.component.d.ts +34 -0
  123. package/src/ui/utils.d.ts +9 -0
@@ -0,0 +1,27 @@
1
+ import { Directive, HostListener } from "@angular/core";
2
+ import { MagicDirective } from '../magic.directive';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "../magic.directive";
5
+ export class InputNoFormControlMagicDirective {
6
+ constructor(magicDirective) {
7
+ this.magicDirective = magicDirective;
8
+ }
9
+ onChange($event) {
10
+ this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
11
+ }
12
+ }
13
+ InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective)); };
14
+ InputNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
15
+ i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
16
+ } } });
17
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
18
+ type: Directive,
19
+ args: [{
20
+ selector: `input[magic]:([noFormControl]):not([type=checkbox]),
21
+ textarea[magic]:([noFormControl]):not([type=checkbox])`
22
+ }]
23
+ }], function () { return [{ type: i1.MagicDirective }]; }, { onChange: [{
24
+ type: HostListener,
25
+ args: ['change', ['$event']]
26
+ }] }); })();
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQubm9mb3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VudCkudmFsdWUpXHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -0,0 +1,193 @@
1
+ import { Directive, ElementRef, Input, Renderer2, ViewContainerRef, Optional } from '@angular/core';
2
+ import { CommandType } from "@magic-xpa/gui";
3
+ import { getGuiEventObj } from "@magic-xpa/engine";
4
+ import { HtmlProperties } from "@magic-xpa/gui";
5
+ import { MagicDirective } from "../magic.directive";
6
+ import { TaskMagicService } from "../../../services/task.magics.service";
7
+ import { StylesMapManager } from "../../../services/StylesMapManager";
8
+ import { RowMagicDirective } from "./row.magic.directive";
9
+ import { Platform } from "@angular/cdk/platform";
10
+ import * as i0 from "@angular/core";
11
+ import * as i1 from "../../../services/task.magics.service";
12
+ import * as i2 from "@angular/cdk/platform";
13
+ import * as i3 from "./row.magic.directive";
14
+ export class NoControlMagicDirective extends MagicDirective {
15
+ set magic(val) { this.id = val; this.selector = 'magicnc'; }
16
+ ;
17
+ constructor(_task, element, renderer, vcRef, platform, magicRow) {
18
+ super(_task, element, renderer, vcRef, platform, magicRow);
19
+ }
20
+ regEvents() {
21
+ super.regEvents();
22
+ if (this.htmlElement instanceof HTMLSelectElement) {
23
+ this.htmlElement.addEventListener('change', (e) => {
24
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
25
+ guiEvent.Value = (event.target).selectedIndex.toString();
26
+ this.task.insertEvent(guiEvent);
27
+ });
28
+ }
29
+ if (this.isRadio()) {
30
+ this.htmlElement.addEventListener('change', (e) => {
31
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
32
+ guiEvent.Value = (e.target).value;
33
+ this.task.insertEvent(guiEvent);
34
+ });
35
+ }
36
+ if (this.isTabControl()) {
37
+ const tabControl = this.htmlElement.children[0];
38
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
39
+ for (var i = 0; i < tabControl.children.length; i++) {
40
+ tabControl.children[i].addEventListener('click', (e) => {
41
+ guiEvent.Value = (e.currentTarget.getAttribute('layer') - 1).toString();
42
+ this.task.insertEvent(guiEvent);
43
+ });
44
+ }
45
+ }
46
+ }
47
+ isTabControl() {
48
+ return this.htmlElement instanceof HTMLDivElement &&
49
+ this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
50
+ }
51
+ isRadio() {
52
+ return this.htmlElement instanceof HTMLDivElement &&
53
+ this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
54
+ }
55
+ handleCommand(command) {
56
+ super.handleCommand(command);
57
+ switch (command.CommandType) {
58
+ case CommandType.SET_CLASS:
59
+ const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
60
+ if (controlMetadata.removedClass != '') {
61
+ this.htmlElement.classList.remove(controlMetadata.removedClass);
62
+ controlMetadata.removedClass = '';
63
+ }
64
+ this.htmlElement.classList.add(command.obj1);
65
+ break;
66
+ case CommandType.SET_VALUE:
67
+ if (this.htmlElement instanceof HTMLLabelElement)
68
+ this.htmlElement.innerText = command.value;
69
+ if (this.htmlElement instanceof HTMLSelectElement)
70
+ this.htmlElement.value = command.value;
71
+ if (this.htmlElement instanceof HTMLAnchorElement)
72
+ this.htmlElement.text = command.value;
73
+ if (this.htmlElement instanceof HTMLInputElement) {
74
+ if (this.htmlElement.type === "checkbox") {
75
+ this.htmlElement.checked = command.value;
76
+ }
77
+ else {
78
+ this.htmlElement.value = command.value;
79
+ }
80
+ }
81
+ if (this.htmlElement instanceof HTMLButtonElement) {
82
+ this.htmlElement.innerHTML = command.value;
83
+ }
84
+ break;
85
+ case CommandType.SET_PROPERTY:
86
+ this.handleSetProperty(command);
87
+ break;
88
+ case CommandType.SET_STYLE:
89
+ let value = StylesMapManager.magicValueGetStyle(command.Operation, command.obj1);
90
+ let attribute = StylesMapManager.MagicPropertyToHtmlAttributeMap.get(command.Operation);
91
+ this.htmlElement.setAttribute("style", attribute + ":" + value);
92
+ break;
93
+ }
94
+ }
95
+ handleSetProperty(command) {
96
+ super.handleSetProperty(command);
97
+ switch (command.Operation) {
98
+ case HtmlProperties.Text:
99
+ if (this.htmlElement instanceof HTMLLabelElement)
100
+ this.htmlElement.innerText = command.obj1;
101
+ break;
102
+ case HtmlProperties.Image:
103
+ if (this.htmlElement instanceof HTMLImageElement)
104
+ this.htmlElement.src = command.obj1;
105
+ else
106
+ this.htmlElement.setAttribute("src", command.obj1);
107
+ break;
108
+ case HtmlProperties.ItemsList:
109
+ if (this.htmlElement instanceof HTMLSelectElement) {
110
+ var len = this.htmlElement.length;
111
+ for (var i = len - 1; i >= 0; i--) {
112
+ this.htmlElement.remove(i);
113
+ }
114
+ for (let s of command.obj1) {
115
+ let elem = document.createElement("option");
116
+ elem.text = s.displayValue;
117
+ elem.value = s.index;
118
+ this.htmlElement.add(elem);
119
+ }
120
+ }
121
+ else if (this.isTabControl() && this.htmlElement.children.length > 0) {
122
+ const tabControl = this.htmlElement.children[0];
123
+ for (var i = 0; i < tabControl.children.length; i++) {
124
+ if (tabControl.children[i] instanceof HTMLButtonElement) {
125
+ tabControl.children[i].innerText = command.obj1[i].displayValue;
126
+ }
127
+ }
128
+ }
129
+ break;
130
+ case HtmlProperties.Visible:
131
+ this.htmlElement.setAttribute('style', 'visibility:' + (command.obj1 ? 'visible' : 'hidden'));
132
+ break;
133
+ case HtmlProperties.Enabled:
134
+ if (command.obj1 === false)
135
+ this.htmlElement.setAttribute("disabled", "true");
136
+ else
137
+ this.htmlElement.removeAttribute("disabled");
138
+ break;
139
+ case HtmlProperties.TabIndex:
140
+ this.htmlElement.setAttribute(command.Operation, command.obj1);
141
+ break;
142
+ case HtmlProperties.SelectedValue:
143
+ if (this.htmlElement instanceof HTMLSelectElement)
144
+ this.htmlElement.value = command.obj1;
145
+ else if (this.isTabControl() && this.htmlElement.children.length > 0) {
146
+ const tabControl = this.htmlElement.children[0];
147
+ for (var i = 0; i < tabControl.children.length; i++) {
148
+ let child = tabControl.children[i];
149
+ const layer = child.getAttribute('layer') - 1;
150
+ if (child instanceof HTMLButtonElement) {
151
+ if (layer == command.obj1) {
152
+ child.classList.add('tab_button_active');
153
+ }
154
+ else {
155
+ child.classList.remove('tab_button_active');
156
+ }
157
+ }
158
+ else {
159
+ let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
160
+ child.setAttribute('style', style);
161
+ }
162
+ }
163
+ }
164
+ break;
165
+ case HtmlProperties.PlaceHolder:
166
+ this.htmlElement.setAttribute("placeholder", command.obj1);
167
+ break;
168
+ case HtmlProperties.Tooltip:
169
+ this.htmlElement.setAttribute("title", command.obj1);
170
+ break;
171
+ case HtmlProperties.Password:
172
+ if (command.obj1 === false)
173
+ this.htmlElement.setAttribute("type", "text");
174
+ else
175
+ this.htmlElement.setAttribute("type", "password");
176
+ break;
177
+ }
178
+ }
179
+ }
180
+ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(i1.TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2.Platform), i0.ɵɵdirectiveInject(i3.RowMagicDirective, 8)); };
181
+ NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
182
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
183
+ type: Directive,
184
+ args: [{
185
+ selector: '[magicnc]'
186
+ }]
187
+ }], function () { return [{ type: i1.TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2.Platform }, { type: i3.RowMagicDirective, decorators: [{
188
+ type: Optional
189
+ }] }]; }, { magic: [{
190
+ type: Input,
191
+ args: ['magicnc']
192
+ }] }); })();
193
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9jb250cm9sLm1hZ2lj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ICB0aGlzLmh0bWxFbGVtZW50LnNldEF0dHJpYnV0ZShcInR5cGVcIiwgXCJ0ZXh0XCIpO1xyXG4gICAgICAgIGVsc2VcclxuICAgICAgICAgIHRoaXMuaHRtbEVsZW1lbnQuc2V0QXR0cmlidXRlKFwidHlwZVwiLCBcInBhc3N3b3JkXCIpO1xyXG4gICAgICAgIGJyZWFrO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0=
@@ -0,0 +1,58 @@
1
+ import { Directive, ElementRef, HostListener, Input } from "@angular/core";
2
+ import { TaskMagicService } from "../../../services/task.magics.service";
3
+ import { getGuiEventObj } from "@magic-xpa/engine";
4
+ import { filter } from "rxjs/operators";
5
+ import { MagicDirective } from "../../directives/magic.directive";
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "../../../services/task.magics.service";
8
+ export class RowMagicDirective {
9
+ constructor(_task, element) {
10
+ this._task = _task;
11
+ this.element = element;
12
+ this.rowChangedSubscriber = null;
13
+ this.htmlElement = this.element.nativeElement;
14
+ }
15
+ ngOnInit() {
16
+ this.rowChangedSubscriber = this._task
17
+ .OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
18
+ .subscribe(rowId => {
19
+ if (!this.isInView(this.htmlElement))
20
+ this.htmlElement.scrollIntoView();
21
+ });
22
+ }
23
+ isInView(element) {
24
+ const rect = element.getBoundingClientRect();
25
+ const parentRect = element.parentElement.getBoundingClientRect();
26
+ return (rect.top >= parentRect.top &&
27
+ rect.bottom <= parentRect.bottom);
28
+ }
29
+ ngOnDestroy() {
30
+ if (this.rowChangedSubscriber !== null) {
31
+ this.rowChangedSubscriber.unsubscribe();
32
+ }
33
+ }
34
+ onClick($event) {
35
+ if (this.rowId != '') {
36
+ this._task.insertEvent(getGuiEventObj('click', "magicRow", +this.rowId));
37
+ if (MagicDirective.noOfAutoCompleteBoxesOpened < 1)
38
+ event.cancelBubble = true;
39
+ }
40
+ }
41
+ }
42
+ RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(i0.ɵɵdirectiveInject(i1.TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
43
+ RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
44
+ i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
45
+ } }, inputs: { rowId: ["magicRow", "rowId"] } });
46
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RowMagicDirective, [{
47
+ type: Directive,
48
+ args: [{
49
+ selector: '[magicRow]'
50
+ }]
51
+ }], function () { return [{ type: i1.TaskMagicService }, { type: i0.ElementRef }]; }, { rowId: [{
52
+ type: Input,
53
+ args: ['magicRow']
54
+ }], onClick: [{
55
+ type: HostListener,
56
+ args: ['click', ['$event']]
57
+ }] }); })();
58
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm93Lm1hZ2ljLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXIvc3JjL3VpL2RpcmVjdGl2ZXMvbWFnaWMvcm93Lm1hZ2ljLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFxQixNQUFNLGVBQWUsQ0FBQztBQUM5RixPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSx1Q0FBdUMsQ0FBQztBQUN2RSxPQUFPLEVBQUMsY0FBYyxFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDakQsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNL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9yIG51bWJlciBvZiByb3dzIGluIHRoZSBwYWdlIGJ1dCBoZXJlIHRoaXMucm93SWQgaXMgdW5kZWZpbmVkLlxyXG4gICAgLy8gU2luY2UgbmdPbkluaXQoKSB3YXMgbm90IGNhbGxlZCBmb3IgYWxsIHRoZXNlIHJvd3MsIHRoaXMucm93Q2hhbmdlZFN1YnNjcmliZXJcclxuICAgIC8vIGlzIG51bGwgYW5kIGhlbmNlIGNyYXNoZXMuXHJcbiAgICAvLyBTbywgdGhlIGNvbmRpdGlvbiB0byBjaGVjayBudWxpdHkgaXMgYWRkZWQuXHJcbiAgICBpZiAodGhpcy5yb3dDaGFuZ2VkU3Vic2NyaWJlciAhPT0gbnVsbCkge1xyXG4gICAgICB0aGlzLnJvd0NoYW5nZWRTdWJzY3JpYmVyLnVuc3Vic2NyaWJlKCk7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICBASG9zdExpc3RlbmVyKCdjbGljaycsIFsnJGV2ZW50J10pXHJcbiAgb25DbGljaygkZXZlbnQpIHtcclxuICAgIGlmKHRoaXMucm93SWQgIT0gJycpIHtcclxuICAgICAgdGhpcy5fdGFzay5pbnNlcnRFdmVudChnZXRHdWlFdmVudE9iaignY2xpY2snLCBcIm1hZ2ljUm93XCIsICt0aGlzLnJvd0lkKSk7XHJcbiAgICAgIGlmIChNYWdpY0RpcmVjdGl2ZS5ub09mQXV0b0NvbXBsZXRlQm94ZXNPcGVuZWQgPCAxKVxyXG4gICAgICAgIGV2ZW50LmNhbmNlbEJ1YmJsZSA9IHRydWU7XHJcbiAgICB9XHJcbiAgfVxyXG4gfVxyXG4iXX0=
@@ -0,0 +1,19 @@
1
+ import { Directive, ElementRef } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export class MagicFocusDirective {
4
+ constructor(hostElement) {
5
+ this.hostElement = hostElement;
6
+ }
7
+ ngAfterViewInit() {
8
+ this.hostElement.nativeElement.focus();
9
+ }
10
+ }
11
+ MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
12
+ MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
13
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicFocusDirective, [{
14
+ type: Directive,
15
+ args: [{
16
+ selector: '[magicFocus]'
17
+ }]
18
+ }], function () { return [{ type: i0.ElementRef }]; }, null); })();
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFnaWMtZm9jdXMuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5ndWxhci9zcmMvdWkvZGlyZWN0aXZlcy9tYWdpYy1mb2N1cy5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBUXRELE1BQU0sT0FBTyxtQkFBbUI7SUFFOUIsWUFBb0IsV0FBdUI7UUFBdkIsZ0JBQVcsR0FBWCxXQUFXLENBQVk7SUFBRyxDQUFDO0lBQy9DLGVBQWU7UUFDYixJQUFJLENBQUMsV0FBVyxDQUFDLGFBQWEsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUN6QyxDQUFDOztzRkFMVSxtQkFBbUI7d0RBQW5CLG1CQUFtQjt1RkFBbkIsbUJBQW1CO2NBSC9CLFNBQVM7ZUFBQztnQkFDVCxRQUFRLEVBQUUsY0FBYzthQUN6QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSwgRWxlbWVudFJlZiB9IGZyb20gXCJAYW5ndWxhci9jb3JlXCI7XHJcblxyXG4vKipcclxuICogRGlyZWN0aXZlIGZvciBzZXR0aW5nIGZvY3VzIG9uIGVsZW1lbnRcclxuICovXHJcbkBEaXJlY3RpdmUoe1xyXG4gIHNlbGVjdG9yOiAnW21hZ2ljRm9jdXNdJ1xyXG59KVxyXG5leHBvcnQgY2xhc3MgTWFnaWNGb2N1c0RpcmVjdGl2ZSAge1xyXG5cclxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGhvc3RFbGVtZW50OiBFbGVtZW50UmVmKSB7fVxyXG4gIG5nQWZ0ZXJWaWV3SW5pdCgpIHtcclxuICAgIHRoaXMuaG9zdEVsZW1lbnQubmF0aXZlRWxlbWVudC5mb2N1cygpO1xyXG4gIH1cclxuXHJcbn1cclxuIl19
@@ -0,0 +1,215 @@
1
+ import { Directive, ElementRef, Input, Optional, Renderer2, ViewContainerRef } from "@angular/core";
2
+ import { isNullOrUndefined } from "@magic-xpa/mscorelib";
3
+ import { CommandType, GuiConstants, HtmlProperties, InteractiveCommandType, Modifiers } from "@magic-xpa/gui";
4
+ import { getGuiEventObj } from "@magic-xpa/engine";
5
+ import { TaskBaseMagicComponent } from "../task-base.magic.component";
6
+ import { TaskMagicService } from "../../services/task.magics.service";
7
+ import { debounceTime, filter, map } from "rxjs/operators";
8
+ import { RowMagicDirective } from "./magic/row.magic.directive";
9
+ import { fromEvent } from "rxjs";
10
+ import { BindingLevel, MgControlType, StorageAttributeType } from "@magic-xpa/utils";
11
+ import { Platform } from "@angular/cdk/platform";
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "../../services/task.magics.service";
14
+ import * as i2 from "@angular/cdk/platform";
15
+ import * as i3 from "./magic/row.magic.directive";
16
+ export class MagicDirective {
17
+ set magic(val) {
18
+ this.id = val;
19
+ this.selector = "magic";
20
+ }
21
+ ;
22
+ set eventsOnly(val) {
23
+ console.log("eventsOnly");
24
+ this.eventsOnlyVal = true;
25
+ }
26
+ ;
27
+ constructor(_task, element, renderer, vcRef, platform, magicRow) {
28
+ this._task = _task;
29
+ this.element = element;
30
+ this.renderer = renderer;
31
+ this.vcRef = vcRef;
32
+ this.platform = platform;
33
+ this.magicRow = magicRow;
34
+ this.eventHandlers = {};
35
+ this.eventsOnlyVal = false;
36
+ this.htmlElement = this.element.nativeElement;
37
+ if (!(typeof magicRow === "undefined" || magicRow === null))
38
+ this.rowId = magicRow.rowId;
39
+ }
40
+ get task() {
41
+ return this._task;
42
+ }
43
+ regEvents() {
44
+ this.eventHandlers["focusin"] = this.OnFocus.bind(this);
45
+ Object.keys(this.eventHandlers).forEach((key) => {
46
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
47
+ });
48
+ let events = ["click", "mousedown", "dblclick"];
49
+ events.forEach(event => {
50
+ this.renderer.listen(this.htmlElement, event, (e) => {
51
+ let fromButton = false;
52
+ if (this.htmlElement instanceof HTMLButtonElement)
53
+ fromButton = true;
54
+ if (fromButton && (this.platform.IOS || this.platform.SAFARI))
55
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
56
+ this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
57
+ if (MagicDirective.noOfAutoCompleteBoxesOpened < 1)
58
+ e.cancelBubble = true;
59
+ });
60
+ });
61
+ this.renderer.listen(this.htmlElement, "change", (e) => {
62
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, +this.rowId);
63
+ if ((event.target).selectedIndex !== undefined) {
64
+ guiEvent.Value = (event.target).selectedIndex.toString();
65
+ e.cancelBubble = true;
66
+ this.task.insertEvent(guiEvent);
67
+ }
68
+ });
69
+ fromEvent(this.htmlElement, "input").pipe(map((event) => {
70
+ return event.target.value;
71
+ }), debounceTime(200)).subscribe((x) => {
72
+ if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
73
+ let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
74
+ if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
75
+ this.task.mgAccessorService.setValueToControl(this.id, x, true);
76
+ }
77
+ });
78
+ this.renderer.listen(this.htmlElement, "keydown", (e) => {
79
+ let guiEvent = getGuiEventObj("keydown", this.id, +this.rowId);
80
+ guiEvent.modifiers = Modifiers.MODIFIER_NONE;
81
+ if (e.altKey && e.keyCode !== GuiConstants.KEY_ALT)
82
+ guiEvent.modifiers = Modifiers.MODIFIER_ALT;
83
+ else if (e.ctrlKey && e.keyCode !== GuiConstants.KEY_CTRL)
84
+ guiEvent.modifiers = Modifiers.MODIFIER_CTRL;
85
+ let supportedKey = e.keyCode === GuiConstants.KEY_PG_UP ||
86
+ e.keyCode === GuiConstants.KEY_PG_DOWN ||
87
+ e.keyCode === GuiConstants.KEY_LEFT ||
88
+ e.keyCode === GuiConstants.KEY_RIGHT ||
89
+ e.keyCode === GuiConstants.KEY_UP ||
90
+ e.keyCode === GuiConstants.KEY_DOWN ||
91
+ e.keyCode === GuiConstants.KEY_ESC ||
92
+ e.keyCode === GuiConstants.KEY_HOME ||
93
+ e.keyCode === GuiConstants.KEY_END ||
94
+ e.keyCode === GuiConstants.KEY_RETURN ||
95
+ (e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
96
+ if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
97
+ guiEvent.keyCode = e.keyCode;
98
+ if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && (!MagicDirective.opened && MagicDirective.noOfAutoCompleteBoxesOpened < 1))
99
+ e.cancelBubble = true;
100
+ this.task.insertEvent(guiEvent);
101
+ }
102
+ });
103
+ }
104
+ OnFocus() {
105
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
106
+ event.cancelBubble = true;
107
+ }
108
+ IsSameElement(command) {
109
+ let line = command.line;
110
+ if (this.task.isTableControl(command.CtrlName))
111
+ line = this.task.getGuiRowId(line, true);
112
+ return (command.CtrlName === this.id &&
113
+ (line === +this.rowId ||
114
+ (line === 0 && isNullOrUndefined(this.rowId))));
115
+ }
116
+ IsSameComponent(command) {
117
+ return (command.controlName === this.id);
118
+ }
119
+ regUpdatesUI() {
120
+ this.subscribeRefreshDom = this.task
121
+ .refreshDom.pipe(filter(c => this.IsSameElement(c)))
122
+ .subscribe(a => {
123
+ let command = a;
124
+ if (isNullOrUndefined(this.rowId))
125
+ this.rowId = "0";
126
+ try {
127
+ if (!this.eventsOnlyVal)
128
+ this.handleCommand(command);
129
+ }
130
+ catch (ex) {
131
+ console.dir(ex);
132
+ }
133
+ });
134
+ this.subscribeInteractiveCommands = this.task.interactiveCommands
135
+ .pipe(filter(c => this.IsSameComponent(c)))
136
+ .subscribe(command => {
137
+ this.handleInteractiveCommands(command);
138
+ });
139
+ }
140
+ ngOnInit() {
141
+ this.regEvents();
142
+ this.regUpdatesUI();
143
+ }
144
+ handleCommand(command) {
145
+ switch (command.CommandType) {
146
+ case CommandType.SET_PROPERTY:
147
+ this.handleSetProperty(command);
148
+ break;
149
+ case CommandType.SET_FOCUS:
150
+ this.focusUnlistener();
151
+ if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
152
+ this.htmlElement.focus();
153
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
154
+ break;
155
+ }
156
+ }
157
+ handleInteractiveCommands(command) {
158
+ switch (command._commandType) {
159
+ case InteractiveCommandType.CALL_JS:
160
+ let methodName = command._str;
161
+ let args = command.arguments;
162
+ let magicComponent = (this.vcRef._hostLView).find(v => v instanceof TaskBaseMagicComponent);
163
+ let resultString = "";
164
+ try {
165
+ if (!isNullOrUndefined(magicComponent[methodName])) {
166
+ resultString = magicComponent[methodName].apply(magicComponent, args);
167
+ }
168
+ else
169
+ console.error("Instance method " + methodName + " does not exists");
170
+ }
171
+ catch (e) {
172
+ console.error(e.message);
173
+ }
174
+ command.resultString = resultString;
175
+ break;
176
+ }
177
+ }
178
+ handleSetProperty(command) {
179
+ switch (command.Operation) {
180
+ case HtmlProperties.ReadOnly:
181
+ {
182
+ if (command.obj.Type == MgControlType.CTRL_TYPE_TEXT)
183
+ if (command.obj1 != true)
184
+ this.renderer.removeAttribute(this.htmlElement, command.Operation);
185
+ else
186
+ this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
187
+ }
188
+ break;
189
+ }
190
+ }
191
+ ngOnDestroy() {
192
+ this.subscribeRefreshDom.unsubscribe();
193
+ }
194
+ }
195
+ MagicDirective.opened = false;
196
+ MagicDirective.noOfAutoCompleteBoxesOpened = 0;
197
+ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(i1.TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2.Platform), i0.ɵɵdirectiveInject(i3.RowMagicDirective, 8)); };
198
+ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
199
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
200
+ type: Directive,
201
+ args: [{
202
+ selector: "[magic]"
203
+ }]
204
+ }], function () { return [{ type: i1.TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2.Platform }, { type: i3.RowMagicDirective, decorators: [{
205
+ type: Optional
206
+ }] }]; }, { magic: [{
207
+ type: Input,
208
+ args: ["magic"]
209
+ }], eventsOnly: [{
210
+ type: Input,
211
+ args: ["eventsOnly"]
212
+ }], rowId: [{
213
+ type: Input
214
+ }] }); })();
215
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFnaWMuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc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RlID09PSBHdWlDb25zdGFudHMuS0VZX1BHX1VQIHx8XHJcbiAgICAgICAgICAgIGUua2V5Q29kZSA9PT0gR3VpQ29uc3RhbnRzLktFWV9QR19ET1dOIHx8XHJcbiAgICAgICAgICAgIGUua2V5Q29kZSA9PT0gR3VpQ29uc3RhbnRzLktFWV9MRUZUIHx8XHJcbiAgICAgICAgICAgIGUua2V5Q29kZSA9PT0gR3VpQ29uc3RhbnRzLktFWV9SSUdIVCB8fFxyXG4gICAgICAgICAgICBlLmtleUNvZGUgPT09IEd1aUNvbnN0YW50cy5LRVlfVVAgfHxcclxuICAgICAgICAgICAgZS5rZXlDb2RlID09PSBHdWlDb25zdGFudHMuS0VZX0RPV04gfHxcclxuICAgICAgICAgICAgZS5rZXlDb2RlID09PSBHdWlDb25zdGFudHMuS0VZX0VTQyB8fFxyXG4gICAgICAgICAgICBlLmtleUNvZGUgPT09IEd1aUNvbnN0YW50cy5LRVlfSE9NRSB8fFxyXG4gICAgICAgICAgICBlLmtleUNvZGUgPT09IEd1aUNvbnN0YW50cy5LRVlfRU5EIHx8XHJcbiAgICAgICAgICAgIGUua2V5Q29kZSA9PT0gR3VpQ29uc3RhbnRzLktFWV9SRVRVUk4gfHxcclxuICAgICAgICAgICAgKGUua2V5Q29kZSA+PSBHdWlDb25zdGFudHMuS0VZX0YxICYmIGUua2V5Q29kZSA8PSBHdWlDb25zdGFudHMuS0VZX0YxMik7XHJcblxyXG4gICAgICAgIGlmIChndWlFdmVudC5tb2RpZmllcnMgIT09IE1vZGlmaWVycy5NT0RJRklFUl9OT05FIHx8IHN1cHBvcnRlZEtleSkge1xyXG4gICAgICAgICAgICBndWlFdmVudC5rZXlDb2RlID0gZS5rZXlDb2RlO1xyXG5cclxuICAgICAgICAgICAgLy8gRGVmZWN0IDE2MDAyMSBmaXhlZCAtIGRvbid0IHNldCBlLmNhbmNlbEJ1YmJsZSB3aGVuIGNvbWJvYm94IGlzIG9wZW5lZCBhbmQgZXNjIGtleSBpcyBw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