@magic-xpa/angular 4.1100.0-dev4110.25 → 4.1100.0-dev4110.250

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 (171) hide show
  1. package/{esm2020 → esm2022}/index.mjs +59 -59
  2. package/{esm2020 → esm2022}/magic-xpa-angular.mjs +1 -1
  3. package/esm2022/src/controls.metadata.model.mjs +183 -0
  4. package/{esm2020 → esm2022}/src/interfaces/sub-form-definition.iterface.mjs +1 -1
  5. package/{esm2020 → esm2022}/src/magic.core.module.mjs +159 -160
  6. package/{esm2020 → esm2022}/src/services/ISubformMagicService.mjs +1 -1
  7. package/esm2022/src/services/OverlayWindowService.mjs +244 -0
  8. package/esm2022/src/services/StylesMapManager.mjs +28 -0
  9. package/esm2022/src/services/accessor.magic.service.mjs +358 -0
  10. package/esm2022/src/services/commands-collector.magic.service.mjs +47 -0
  11. package/esm2022/src/services/component-list.magic.service.mjs +45 -0
  12. package/{esm2020 → esm2022}/src/services/confirmation.components.magic.provider.mjs +21 -21
  13. package/esm2022/src/services/engine.magic.service.mjs +80 -0
  14. package/{esm2020 → esm2022}/src/services/exit.magic.service.mjs +13 -13
  15. package/esm2022/src/services/magic-color.service.mjs +101 -0
  16. package/{esm2020 → esm2022}/src/services/magic.lazy.loader.service.mjs +16 -16
  17. package/{esm2020 → esm2022}/src/services/magic.providers.mjs +24 -24
  18. package/esm2022/src/services/magic.services.mjs +36 -0
  19. package/esm2022/src/services/mg-date-adapter.mjs +108 -0
  20. package/{esm2020 → esm2022}/src/services/overlay.conainer.magic.provider.mjs +14 -14
  21. package/esm2022/src/services/router-commands.magic.service.mjs +31 -0
  22. package/esm2022/src/services/subform.magic.service.mjs +194 -0
  23. package/esm2022/src/services/table.magic.service.mjs +81 -0
  24. package/esm2022/src/services/task.magics.service.mjs +637 -0
  25. package/esm2022/src/services/title.magic.service.mjs +19 -0
  26. package/esm2022/src/ui/GuiInteractiveExecutor.mjs +109 -0
  27. package/esm2022/src/ui/components/base-magic-alert.component.mjs +24 -0
  28. package/esm2022/src/ui/components/base-magic-confirm.component.mjs +24 -0
  29. package/esm2022/src/ui/components/magic-alert.component.mjs +36 -0
  30. package/esm2022/src/ui/components/magic-confirmation-box.component.mjs +42 -0
  31. package/esm2022/src/ui/directives/NonMagicControlDirective.mjs +58 -0
  32. package/esm2022/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +29 -0
  33. package/esm2022/src/ui/directives/magic/checkbox.magic.directive.mjs +29 -0
  34. package/esm2022/src/ui/directives/magic/combobox.magic.directive.mjs +37 -0
  35. package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +27 -0
  36. package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +85 -0
  37. package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +32 -0
  38. package/esm2022/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +28 -0
  39. package/esm2022/src/ui/directives/magic/nocontrol.magic.directive.mjs +193 -0
  40. package/esm2022/src/ui/directives/magic/row.magic.directive.mjs +62 -0
  41. package/esm2022/src/ui/directives/magic-focus.directive.mjs +20 -0
  42. package/esm2022/src/ui/directives/magic.directive.mjs +229 -0
  43. package/esm2022/src/ui/directives/magicViewContainerRef.directive.mjs +20 -0
  44. package/esm2022/src/ui/directives/mgformat.magic.directive.mjs +579 -0
  45. package/esm2022/src/ui/directives/range-validator.magic.directive.mjs +60 -0
  46. package/{esm2020 → esm2022}/src/ui/magic-confirmationBox.mjs +42 -42
  47. package/{esm2020 → esm2022}/src/ui/magic-modal/base-magic-overlay-container.mjs +22 -22
  48. package/esm2022/src/ui/magic-modal/magic-modal-form.mjs +6 -0
  49. package/{esm2020 → esm2022}/src/ui/magic-modal/magic-modal-interface.mjs +1 -1
  50. package/esm2022/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +124 -0
  51. package/esm2022/src/ui/magic-modal/magic-overlay-container.mjs +162 -0
  52. package/esm2022/src/ui/magic-root.component.mjs +236 -0
  53. package/esm2022/src/ui/mgerror.magic.component.mjs +125 -0
  54. package/esm2022/src/ui/pipes/date.magic.pipe.mjs +106 -0
  55. package/esm2022/src/ui/pipes/time.magic.pipe.mjs +52 -0
  56. package/esm2022/src/ui/pipes/time24.magic.pipe.mjs +35 -0
  57. package/esm2022/src/ui/router-container.magic.component.mjs +115 -0
  58. package/{esm2020 → esm2022}/src/ui/subform.magic.component.mjs +50 -46
  59. package/esm2022/src/ui/task-base.magic.component.mjs +91 -0
  60. package/esm2022/src/ui/utils.mjs +54 -0
  61. package/{fesm2020 → fesm2022}/magic-xpa-angular.mjs +4827 -4444
  62. package/fesm2022/magic-xpa-angular.mjs.map +1 -0
  63. package/index.d.ts +58 -58
  64. package/package.json +10 -16
  65. package/src/controls.metadata.model.d.ts +62 -62
  66. package/src/interfaces/sub-form-definition.iterface.d.ts +12 -12
  67. package/src/magic.core.module.d.ts +41 -41
  68. package/src/services/ISubformMagicService.d.ts +4 -4
  69. package/src/services/OverlayWindowService.d.ts +30 -25
  70. package/src/services/StylesMapManager.d.ts +5 -5
  71. package/src/services/accessor.magic.service.d.ts +69 -69
  72. package/src/services/commands-collector.magic.service.d.ts +15 -15
  73. package/src/services/component-list.magic.service.d.ts +23 -23
  74. package/src/services/confirmation.components.magic.provider.d.ts +8 -8
  75. package/src/services/engine.magic.service.d.ts +27 -27
  76. package/src/services/exit.magic.service.d.ts +6 -6
  77. package/src/services/magic-color.service.d.ts +19 -19
  78. package/src/services/magic.lazy.loader.service.d.ts +6 -6
  79. package/src/services/magic.providers.d.ts +107 -107
  80. package/src/services/magic.services.d.ts +16 -16
  81. package/src/services/mg-date-adapter.d.ts +38 -40
  82. package/src/services/overlay.conainer.magic.provider.d.ts +7 -7
  83. package/src/services/router-commands.magic.service.d.ts +17 -17
  84. package/src/services/subform.magic.service.d.ts +43 -43
  85. package/src/services/table.magic.service.d.ts +30 -30
  86. package/src/services/task.magics.service.d.ts +100 -100
  87. package/src/services/title.magic.service.d.ts +9 -9
  88. package/src/ui/GuiInteractiveExecutor.d.ts +22 -21
  89. package/src/ui/components/base-magic-alert.component.d.ts +10 -10
  90. package/src/ui/components/base-magic-confirm.component.d.ts +10 -10
  91. package/src/ui/components/magic-alert.component.d.ts +6 -6
  92. package/src/ui/components/magic-confirmation-box.component.d.ts +6 -6
  93. package/src/ui/directives/NonMagicControlDirective.d.ts +26 -26
  94. package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +9 -9
  95. package/src/ui/directives/magic/checkbox.magic.directive.d.ts +9 -9
  96. package/src/ui/directives/magic/combobox.magic.directive.d.ts +10 -10
  97. package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +7 -7
  98. package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +23 -17
  99. package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +7 -7
  100. package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +9 -9
  101. package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +18 -18
  102. package/src/ui/directives/magic/row.magic.directive.d.ts +17 -17
  103. package/src/ui/directives/magic-focus.directive.d.ts +9 -9
  104. package/src/ui/directives/magic.directive.d.ts +44 -44
  105. package/src/ui/directives/magicViewContainerRef.directive.d.ts +8 -8
  106. package/src/ui/directives/mgformat.magic.directive.d.ts +38 -31
  107. package/src/ui/directives/range-validator.magic.directive.d.ts +17 -17
  108. package/src/ui/magic-confirmationBox.d.ts +6 -6
  109. package/src/ui/magic-modal/base-magic-overlay-container.d.ts +5 -5
  110. package/src/ui/magic-modal/magic-modal-form.d.ts +5 -5
  111. package/src/ui/magic-modal/magic-modal-interface.d.ts +10 -10
  112. package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +30 -31
  113. package/src/ui/magic-modal/magic-overlay-container.d.ts +24 -25
  114. package/src/ui/magic-root.component.d.ts +43 -40
  115. package/src/ui/mgerror.magic.component.d.ts +20 -20
  116. package/src/ui/pipes/date.magic.pipe.d.ts +17 -17
  117. package/src/ui/pipes/time.magic.pipe.d.ts +11 -11
  118. package/src/ui/pipes/time24.magic.pipe.d.ts +10 -10
  119. package/src/ui/router-container.magic.component.d.ts +29 -30
  120. package/src/ui/subform.magic.component.d.ts +16 -16
  121. package/src/ui/task-base.magic.component.d.ts +34 -34
  122. package/src/ui/utils.d.ts +9 -9
  123. package/esm2020/src/controls.metadata.model.mjs +0 -180
  124. package/esm2020/src/services/OverlayWindowService.mjs +0 -208
  125. package/esm2020/src/services/StylesMapManager.mjs +0 -28
  126. package/esm2020/src/services/accessor.magic.service.mjs +0 -356
  127. package/esm2020/src/services/commands-collector.magic.service.mjs +0 -46
  128. package/esm2020/src/services/component-list.magic.service.mjs +0 -46
  129. package/esm2020/src/services/engine.magic.service.mjs +0 -82
  130. package/esm2020/src/services/magic-color.service.mjs +0 -99
  131. package/esm2020/src/services/magic.services.mjs +0 -31
  132. package/esm2020/src/services/mg-date-adapter.mjs +0 -109
  133. package/esm2020/src/services/router-commands.magic.service.mjs +0 -28
  134. package/esm2020/src/services/subform.magic.service.mjs +0 -184
  135. package/esm2020/src/services/table.magic.service.mjs +0 -77
  136. package/esm2020/src/services/task.magics.service.mjs +0 -624
  137. package/esm2020/src/services/title.magic.service.mjs +0 -18
  138. package/esm2020/src/ui/GuiInteractiveExecutor.mjs +0 -98
  139. package/esm2020/src/ui/components/base-magic-alert.component.mjs +0 -23
  140. package/esm2020/src/ui/components/base-magic-confirm.component.mjs +0 -23
  141. package/esm2020/src/ui/components/magic-alert.component.mjs +0 -35
  142. package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +0 -41
  143. package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +0 -49
  144. package/esm2020/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +0 -28
  145. package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +0 -28
  146. package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +0 -36
  147. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +0 -27
  148. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +0 -52
  149. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +0 -32
  150. package/esm2020/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +0 -27
  151. package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +0 -193
  152. package/esm2020/src/ui/directives/magic/row.magic.directive.mjs +0 -58
  153. package/esm2020/src/ui/directives/magic-focus.directive.mjs +0 -19
  154. package/esm2020/src/ui/directives/magic.directive.mjs +0 -215
  155. package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +0 -19
  156. package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +0 -408
  157. package/esm2020/src/ui/directives/range-validator.magic.directive.mjs +0 -58
  158. package/esm2020/src/ui/magic-modal/magic-modal-form.mjs +0 -8
  159. package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +0 -121
  160. package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +0 -159
  161. package/esm2020/src/ui/magic-root.component.mjs +0 -203
  162. package/esm2020/src/ui/mgerror.magic.component.mjs +0 -119
  163. package/esm2020/src/ui/pipes/date.magic.pipe.mjs +0 -105
  164. package/esm2020/src/ui/pipes/time.magic.pipe.mjs +0 -51
  165. package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +0 -34
  166. package/esm2020/src/ui/router-container.magic.component.mjs +0 -108
  167. package/esm2020/src/ui/task-base.magic.component.mjs +0 -86
  168. package/esm2020/src/ui/utils.mjs +0 -54
  169. package/fesm2015/magic-xpa-angular.mjs +0 -4832
  170. package/fesm2015/magic-xpa-angular.mjs.map +0 -1
  171. package/fesm2020/magic-xpa-angular.mjs.map +0 -1
@@ -0,0 +1,244 @@
1
+ import { Injectable, Injector, Compiler } from "@angular/core";
2
+ import { ComponentListMagicService } from "./component-list.magic.service";
3
+ import { EngineMagicService } from "./engine.magic.service";
4
+ import { getGuiEventObj } from "@magic-xpa/engine";
5
+ import { OverlayContainerMagicProvider } from "./overlay.conainer.magic.provider";
6
+ import { MagicOverlayContainerWrapper } from "../ui/magic-modal/magic-overlay-container-wrapper";
7
+ import { ConfirmationComponentsMagicProvider } from "./confirmation.components.magic.provider";
8
+ import { OverlayType, Styles } from "@magic-xpa/gui";
9
+ import { confirmationBox } from "../ui/magic-confirmationBox";
10
+ import { isNullOrUndefined } from "@magic-xpa/mscorelib";
11
+ import { MagicLazyLoaderService } from "./magic.lazy.loader.service";
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "./component-list.magic.service";
14
+ import * as i2 from "./engine.magic.service";
15
+ import * as i3 from "./magic.lazy.loader.service";
16
+ import * as i4 from "./overlay.conainer.magic.provider";
17
+ import * as i5 from "./confirmation.components.magic.provider";
18
+ export class OverlayWindowService {
19
+ componentList;
20
+ engineMagicService;
21
+ magicLazyModuleLoader;
22
+ injector;
23
+ compiler;
24
+ overlayContainerMagicProvider;
25
+ confirmationComponentsMagicProvider;
26
+ constructor(componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
27
+ this.componentList = componentList;
28
+ this.engineMagicService = engineMagicService;
29
+ this.magicLazyModuleLoader = magicLazyModuleLoader;
30
+ this.injector = injector;
31
+ this.compiler = compiler;
32
+ this.overlayContainerMagicProvider = overlayContainerMagicProvider;
33
+ this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
34
+ }
35
+ overlayWindowsContainerViewRef;
36
+ overlayWindowFocusManager = null;
37
+ changeDetectorRef = null;
38
+ init(overlayWindowsContainerViewRef, rootMagicElement, changeDetectorRef) {
39
+ this.overlayWindowsContainerViewRef = overlayWindowsContainerViewRef;
40
+ this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
41
+ this.changeDetectorRef = changeDetectorRef;
42
+ }
43
+ loadAndOpenModule(formName, taskId, taskDescription) {
44
+ let moduleRef = this.componentList.getModuleRef(formName);
45
+ if (moduleRef == null) {
46
+ let lazyLoadModule = this.componentList.getLazyLoadModuleData(formName);
47
+ if (lazyLoadModule != null) {
48
+ let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
49
+ moduleName = moduleName.replace("Module", "");
50
+ this.magicLazyModuleLoader.Load(moduleName).then(m => {
51
+ const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
52
+ moduleRef = compiled.ngModuleFactory.create(this.injector);
53
+ this.open(formName, taskId, taskDescription);
54
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
55
+ });
56
+ }
57
+ }
58
+ else {
59
+ this.open(formName, taskId, taskDescription);
60
+ this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
61
+ }
62
+ }
63
+ open(formName, taskId, taskDescription) {
64
+ let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
65
+ let parameters = { taskIdParam: taskId, taskDescription: taskDescription };
66
+ let componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), OverlayType.Overlay);
67
+ componentRef.instance.onClose.subscribe(() => {
68
+ let guiEvent = getGuiEventObj("close", null, 0);
69
+ guiEvent.TaskID = taskId;
70
+ this.engineMagicService.insertEvent(guiEvent);
71
+ });
72
+ this.changeDetectorRef.detectChanges();
73
+ }
74
+ close(commandStr) {
75
+ this.overlayWindowsContainerViewRef.remove();
76
+ this.overlayWindowFocusManager.popDialog();
77
+ let guiEvent1 = getGuiEventObj("dispose", null, 0);
78
+ guiEvent1.TaskID = commandStr;
79
+ this.engineMagicService.insertEvent(guiEvent1);
80
+ }
81
+ openConfirmationBox(title, msg, style) {
82
+ if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
83
+ let res = confirmationBox.showConfirmationBox(title, msg, style);
84
+ this.finishConfirmation(style, res);
85
+ }
86
+ else {
87
+ let comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
88
+ let overlayType = confirmationBox.isConfirmBox(style) ? OverlayType.ConfirmationBox : OverlayType.Alert;
89
+ let componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
90
+ componentRef.instance.onClose.subscribe((res) => {
91
+ this.overlayWindowsContainerViewRef.remove();
92
+ this.overlayWindowFocusManager.popDialog();
93
+ this.finishConfirmation(style, res);
94
+ });
95
+ }
96
+ }
97
+ finishConfirmation(style, result) {
98
+ let guiEvent = getGuiEventObj("confirmationClosed", null, 0);
99
+ guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
100
+ this.engineMagicService.insertEvent(guiEvent);
101
+ }
102
+ createModalComponent(parameters, component, overlayType) {
103
+ let componentRef;
104
+ let magicModalContainerParameters = {
105
+ Component: component,
106
+ Parameters: parameters,
107
+ OverlayTypeParam: overlayType
108
+ };
109
+ let viewCRef = this.overlayWindowsContainerViewRef;
110
+ componentRef = viewCRef.createComponent(MagicOverlayContainerWrapper);
111
+ Object.assign(componentRef.instance, magicModalContainerParameters);
112
+ this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
113
+ componentRef.instance.DetectChanges();
114
+ return componentRef;
115
+ }
116
+ static ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i2.EngineMagicService), i0.ɵɵinject(i3.MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler), i0.ɵɵinject(i4.OverlayContainerMagicProvider), i0.ɵɵinject(i5.ConfirmationComponentsMagicProvider)); };
117
+ static ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
118
+ }
119
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
120
+ type: Injectable,
121
+ args: [{
122
+ providedIn: 'root'
123
+ }]
124
+ }], () => [{ type: i1.ComponentListMagicService }, { type: i2.EngineMagicService }, { type: i3.MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: i4.OverlayContainerMagicProvider }, { type: i5.ConfirmationComponentsMagicProvider }], null); })();
125
+ class OverlayWindowFocusManager {
126
+ rootMagicElement = null;
127
+ openDialogList = new Array(0);
128
+ ignoreUtilFocusChanges = false;
129
+ lastFocus = null;
130
+ focusListener = null;
131
+ constructor(rootMagicElement) {
132
+ this.rootMagicElement = rootMagicElement;
133
+ }
134
+ pushDialog(rootElement) {
135
+ if (this.openDialogList.length === 0) {
136
+ this.focusListener = this.trapFocus.bind(this);
137
+ document.addEventListener('focus', this.focusListener, true);
138
+ }
139
+ this.openDialogList.push(new DialogInfo(rootElement, (document.activeElement instanceof HTMLElement ? document.activeElement : null)));
140
+ }
141
+ popDialog() {
142
+ const dialogInfo = this.openDialogList.pop();
143
+ this.attemptFocus(dialogInfo.FocusElementOnClose);
144
+ if (this.openDialogList.length === 0) {
145
+ document.removeEventListener('focus', this.focusListener, true);
146
+ this.focusListener = null;
147
+ }
148
+ }
149
+ trapFocus(event) {
150
+ if (this.ignoreUtilFocusChanges) {
151
+ return;
152
+ }
153
+ if (this.openDialogList.length > 0) {
154
+ var currentDialog = this.openDialogList[this.openDialogList.length - 1].RootElement;
155
+ if (currentDialog.contains(event.target)) {
156
+ this.lastFocus = event.target;
157
+ }
158
+ else {
159
+ if (this.rootMagicElement.contains(event.target)) {
160
+ this.focusFirstDescendant(currentDialog);
161
+ if (this.lastFocus == document.activeElement) {
162
+ this.focusLastDescendant(currentDialog);
163
+ }
164
+ }
165
+ this.lastFocus = document.activeElement;
166
+ }
167
+ }
168
+ }
169
+ focusFirstDescendant(element) {
170
+ for (var i = 0; i < element.childNodes.length; i++) {
171
+ var child = element.childNodes[i];
172
+ if (this.attemptFocus(child) ||
173
+ this.focusFirstDescendant(child)) {
174
+ return true;
175
+ }
176
+ }
177
+ return false;
178
+ }
179
+ ;
180
+ focusLastDescendant(element) {
181
+ for (var i = element.childNodes.length - 1; i >= 0; i--) {
182
+ var child = element.childNodes[i];
183
+ if (this.attemptFocus(child) ||
184
+ this.focusLastDescendant(child)) {
185
+ return true;
186
+ }
187
+ }
188
+ return false;
189
+ }
190
+ ;
191
+ attemptFocus(element) {
192
+ if (!this.isFocusable(element)) {
193
+ return false;
194
+ }
195
+ this.ignoreUtilFocusChanges = true;
196
+ try {
197
+ element.focus();
198
+ }
199
+ catch (e) {
200
+ }
201
+ this.ignoreUtilFocusChanges = false;
202
+ return (document.activeElement === element);
203
+ }
204
+ ;
205
+ isFocusable(element) {
206
+ if (isNullOrUndefined(element))
207
+ return false;
208
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
209
+ return true;
210
+ }
211
+ else if (element.tabIndex < 0)
212
+ return false;
213
+ if (element.disabled) {
214
+ return false;
215
+ }
216
+ switch (element.nodeName) {
217
+ case 'A':
218
+ return !!element.href && element.rel != 'ignore';
219
+ case 'INPUT':
220
+ return element.type != 'hidden' && element.type != 'file';
221
+ case 'BUTTON':
222
+ case 'SELECT':
223
+ case 'TEXTAREA':
224
+ return true;
225
+ default:
226
+ return false;
227
+ }
228
+ }
229
+ }
230
+ class DialogInfo {
231
+ rootElement;
232
+ focusElementOnClose;
233
+ constructor(rootElement, focusElementOnClose) {
234
+ this.rootElement = rootElement;
235
+ this.focusElementOnClose = focusElementOnClose;
236
+ }
237
+ get RootElement() {
238
+ return this.rootElement;
239
+ }
240
+ get FocusElementOnClose() {
241
+ return this.focusElementOnClose;
242
+ }
243
+ }
244
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3ZlcmxheVdpbmRvd1NlcnZpY2UuanMiLCJzb3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IGVsZW1lbnQucmVsICE9ICdpZ25vcmUnO1xyXG4gICAgICBjYXNlICdJTlBVVCc6XHJcbiAgICAgICAgcmV0dXJuIGVsZW1lbnQudHlwZSAhPSAnaGlkZGVuJyAmJiBlbGVtZW50LnR5cGUgIT0gJ2ZpbGUnO1xyXG4gICAgICBjYXNlICdCVVRUT04nOlxyXG4gICAgICBjYXNlICdTRUxFQ1QnOlxyXG4gICAgICBjYXNlICdURVhUQVJFQSc6XHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG5cclxuY2xhc3MgRGlhbG9nSW5mb1xyXG57XHJcbiAgcHJpdmF0ZSByb290RWxlbWVudDogSFRNTEVsZW1lbnQ7XHJcbiAgcHJpdmF0ZSBmb2N1c0VsZW1lbnRPbkNsb3NlOiBIVE1MRWxlbWVudDtcclxuXHJcbiAgY29uc3RydWN0b3Iocm9vdEVsZW1lbnQ6IEhUTUxFbGVtZW50LCBmb2N1c0VsZW1lbnRPbkNsb3NlOiBIVE1MRWxlbWVudCkge1xyXG4gICAgdGhpcy5yb290RWxlbWVudCA9IHJvb3RFbGVtZW50O1xyXG4gICAgdGhpcy5mb2N1c0VsZW1lbnRPbkNsb3NlID0gZm9jdXNFbGVtZW50T25DbG9zZTtcclxuICB9XHJcblxyXG4gIGdldCBSb290RWxlbWVudCgpOiBIVE1MRWxlbWVudCB7XHJcbiAgICByZXR1cm4gdGhpcy5yb290RWxlbWVudDtcclxuICB9XHJcblxyXG4gIGdldCBGb2N1c0VsZW1lbnRPbkNsb3NlKCk6IEhUTUxFbGVtZW50IHtcclxuICAgIHJldHVybiB0aGlzLmZvY3VzRWxlbWVudE9uQ2xvc2U7XHJcbiAgfVxyXG59XHJcblxyXG5cclxuIl19
@@ -0,0 +1,28 @@
1
+ import { MagicProperties } from "@magic-xpa/utils";
2
+ import { NString, isNullOrUndefined } from "@magic-xpa/mscorelib";
3
+ export class StylesMapManager {
4
+ static StylesMap = new Map([
5
+ [MagicProperties.LineDivider, new Map([[true, "solid"], [false, "hidden"]])],
6
+ [MagicProperties.ImageFile, "url('\{0}\')"],
7
+ [MagicProperties.Wallpaper, "url('\{0}\')"]
8
+ ]);
9
+ static MagicPropertyToHtmlAttributeMap = new Map([
10
+ [MagicProperties.LineDivider, "border-bottom-style"],
11
+ [MagicProperties.ImageFile, "background-image"],
12
+ [MagicProperties.Wallpaper, "background-image"]
13
+ ]);
14
+ static magicValueGetStyle(styleName, magicValue) {
15
+ let style = "";
16
+ if (!isNullOrUndefined(magicValue)) {
17
+ let value = StylesMapManager.StylesMap.get(styleName);
18
+ if (value.constructor === Map) {
19
+ style = value.get(magicValue);
20
+ }
21
+ else if (value.constructor === String) {
22
+ style = NString.Format(value.toString(), magicValue);
23
+ }
24
+ }
25
+ return style;
26
+ }
27
+ }
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3R5bGVzTWFwTWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXIvc3JjL3NlcnZpY2VzL1N0eWxlc01hcE1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLGtCQUFrQixDQUFBO0FBQ2hELE9BQU8sRUFBQyxPQUFPLEVBQUUsaUJBQWlCLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQTtBQUsvRCxNQUFNLE9BQU8sZ0JBQWdCO0lBQzNCLE1BQU0sQ0FBQyxTQUFTLEdBQXFCLElBQUksR0FBRyxDQUMxQztRQUNFLENBQUMsZUFBZSxDQUFDLFdBQVcsRUFBRSxJQUFJLEdBQUcsQ0FBVyxDQUFDLENBQUMsSUFBSSxFQUFFLE9BQ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