@magic-xpa/angular 4.800.0-dev480.13 → 4.800.0-dev480.133

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 (117) hide show
  1. package/bundles/magic-xpa-angular.umd.js +200 -1505
  2. package/bundles/magic-xpa-angular.umd.js.map +1 -1
  3. package/bundles/magic-xpa-angular.umd.min.js +2 -2
  4. package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
  5. package/esm2015/index.js +1 -1
  6. package/esm2015/magic-xpa-angular.js +1 -4
  7. package/esm2015/src/controls.metadata.model.js +3 -36
  8. package/esm2015/src/interfaces/sub-form-definition.iterface.js +1 -1
  9. package/esm2015/src/magic.core.module.js +4 -14
  10. package/esm2015/src/services/ISubformMagicService.js +1 -1
  11. package/esm2015/src/services/OverlayWindowService.js +4 -29
  12. package/esm2015/src/services/StylesMapManager.js +1 -4
  13. package/esm2015/src/services/accessor.magic.service.js +32 -242
  14. package/esm2015/src/services/commands-collector.magic.service.js +4 -7
  15. package/esm2015/src/services/component-list.magic.service.js +1 -25
  16. package/esm2015/src/services/confirmation.components.magic.provider.js +4 -24
  17. package/esm2015/src/services/engine.magic.service.js +7 -10
  18. package/esm2015/src/services/exit.magic.service.js +4 -10
  19. package/esm2015/src/services/magic.providers.js +1 -4
  20. package/esm2015/src/services/magic.services.js +4 -10
  21. package/esm2015/src/services/mg-date-adapter.js +5 -5
  22. package/esm2015/src/services/overlay.conainer.magic.provider.js +4 -8
  23. package/esm2015/src/services/router-commands.magic.service.js +4 -10
  24. package/esm2015/src/services/subform.magic.service.js +8 -48
  25. package/esm2015/src/services/table.magic.service.js +5 -61
  26. package/esm2015/src/services/task.magics.service.js +13 -281
  27. package/esm2015/src/services/title.magic.service.js +4 -15
  28. package/esm2015/src/ui/GuiInteractiveExecutor.js +1 -6
  29. package/esm2015/src/ui/components/base-magic-alert.component.js +4 -14
  30. package/esm2015/src/ui/components/base-magic-confirm.component.js +4 -16
  31. package/esm2015/src/ui/components/magic-alert.component.js +5 -8
  32. package/esm2015/src/ui/components/magic-confirmation-box.component.js +5 -8
  33. package/esm2015/src/ui/directives/NonMagicControlDirective.js +4 -31
  34. package/esm2015/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.js +4 -10
  35. package/esm2015/src/ui/directives/magic/checkbox.magic.directive.js +4 -13
  36. package/esm2015/src/ui/directives/magic/combobox.magic.directive.js +4 -10
  37. package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.js +5 -11
  38. package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.js +4 -16
  39. package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.js +5 -11
  40. package/esm2015/src/ui/directives/magic/input.noformcontrol.magic.directive.js +4 -10
  41. package/esm2015/src/ui/directives/magic/nocontrol.magic.directive.js +6 -16
  42. package/esm2015/src/ui/directives/magic/row.magic.directive.js +4 -22
  43. package/esm2015/src/ui/directives/magic-focus.directive.js +4 -7
  44. package/esm2015/src/ui/directives/magic.directive.js +14 -80
  45. package/esm2015/src/ui/directives/magicViewContainerRef.directive.js +4 -8
  46. package/esm2015/src/ui/directives/mgformat.magic.directive.js +4 -57
  47. package/esm2015/src/ui/directives/range-validator.magic.directive.js +4 -20
  48. package/esm2015/src/ui/magic-confirmationBox.js +1 -25
  49. package/esm2015/src/ui/magic-modal/base-magic-overlay-container.js +1 -1
  50. package/esm2015/src/ui/magic-modal/magic-modal-form.js +1 -4
  51. package/esm2015/src/ui/magic-modal/magic-modal-interface.js +1 -1
  52. package/esm2015/src/ui/magic-modal/magic-overlay-container-wrapper.js +4 -21
  53. package/esm2015/src/ui/magic-modal/magic-overlay-container.js +4 -46
  54. package/esm2015/src/ui/magic-root.component.js +10 -53
  55. package/esm2015/src/ui/mgerror.magic.component.js +4 -21
  56. package/esm2015/src/ui/pipes/date.magic.pipe.js +5 -12
  57. package/esm2015/src/ui/pipes/time.magic.pipe.js +4 -7
  58. package/esm2015/src/ui/router-container.magic.component.js +4 -32
  59. package/esm2015/src/ui/subform.magic.component.js +4 -23
  60. package/esm2015/src/ui/task-base.magic.component.js +4 -74
  61. package/esm2015/src/ui/utils.js +1 -20
  62. package/fesm2015/magic-xpa-angular.js +201 -1509
  63. package/fesm2015/magic-xpa-angular.js.map +1 -1
  64. package/magic-xpa-angular.d.ts +0 -3
  65. package/package.json +3 -3
  66. package/src/controls.metadata.model.d.ts +0 -16
  67. package/src/interfaces/sub-form-definition.iterface.d.ts +0 -6
  68. package/src/magic.core.module.d.ts +0 -3
  69. package/src/services/OverlayWindowService.d.ts +0 -19
  70. package/src/services/StylesMapManager.d.ts +0 -3
  71. package/src/services/accessor.magic.service.d.ts +12 -202
  72. package/src/services/commands-collector.magic.service.d.ts +0 -3
  73. package/src/services/component-list.magic.service.d.ts +0 -27
  74. package/src/services/confirmation.components.magic.provider.d.ts +0 -16
  75. package/src/services/engine.magic.service.d.ts +1 -3
  76. package/src/services/exit.magic.service.d.ts +0 -6
  77. package/src/services/magic.providers.d.ts +0 -3
  78. package/src/services/magic.services.d.ts +0 -6
  79. package/src/services/router-commands.magic.service.d.ts +0 -6
  80. package/src/services/subform.magic.service.d.ts +0 -28
  81. package/src/services/table.magic.service.d.ts +0 -55
  82. package/src/services/task.magics.service.d.ts +1 -294
  83. package/src/services/title.magic.service.d.ts +0 -11
  84. package/src/ui/GuiInteractiveExecutor.d.ts +0 -3
  85. package/src/ui/components/base-magic-alert.component.d.ts +0 -16
  86. package/src/ui/components/base-magic-confirm.component.d.ts +0 -18
  87. package/src/ui/components/magic-alert.component.d.ts +0 -3
  88. package/src/ui/components/magic-confirmation-box.component.d.ts +0 -3
  89. package/src/ui/directives/NonMagicControlDirective.d.ts +0 -41
  90. package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +0 -6
  91. package/src/ui/directives/magic/checkbox.magic.directive.d.ts +0 -9
  92. package/src/ui/directives/magic/combobox.magic.directive.d.ts +0 -6
  93. package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +0 -6
  94. package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +0 -12
  95. package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +0 -6
  96. package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +0 -6
  97. package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +0 -3
  98. package/src/ui/directives/magic/row.magic.directive.d.ts +0 -15
  99. package/src/ui/directives/magic-focus.directive.d.ts +0 -3
  100. package/src/ui/directives/magic.directive.d.ts +0 -78
  101. package/src/ui/directives/magicViewContainerRef.directive.d.ts +0 -3
  102. package/src/ui/directives/mgformat.magic.directive.d.ts +0 -40
  103. package/src/ui/directives/range-validator.magic.directive.d.ts +0 -16
  104. package/src/ui/magic-confirmationBox.d.ts +0 -19
  105. package/src/ui/magic-modal/base-magic-overlay-container.d.ts +0 -9
  106. package/src/ui/magic-modal/magic-modal-form.d.ts +0 -3
  107. package/src/ui/magic-modal/magic-modal-interface.d.ts +0 -27
  108. package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +0 -20
  109. package/src/ui/magic-modal/magic-overlay-container.d.ts +0 -51
  110. package/src/ui/magic-root.component.d.ts +0 -42
  111. package/src/ui/mgerror.magic.component.d.ts +0 -19
  112. package/src/ui/pipes/date.magic.pipe.d.ts +0 -6
  113. package/src/ui/pipes/time.magic.pipe.d.ts +0 -3
  114. package/src/ui/router-container.magic.component.d.ts +0 -19
  115. package/src/ui/subform.magic.component.d.ts +0 -21
  116. package/src/ui/task-base.magic.component.d.ts +0 -72
  117. package/src/ui/utils.d.ts +0 -3
@@ -6,7 +6,7 @@ import { FormGroup, FormControl, Validators, NG_VALIDATORS, NG_VALUE_ACCESSOR, C
6
6
  import { DynamicComponent, DynamicIoDirective, DynamicModule } from 'ng-dynamic-component';
7
7
  import { __awaiter, __decorate, __metadata } from 'tslib';
8
8
  import { Subject } from 'rxjs';
9
- import { MagicBridge, getGuiEventObj } from '@magic-xpa/engine';
9
+ import { MagicBridge, getGuiEventObj, CookieService } from '@magic-xpa/engine';
10
10
  import { InteractiveCommandType, OverlayType, Styles, HtmlProperties, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
11
11
  import { MagicProperties, StorageAttribute, Logger, BindingLevel, StorageAttributeType, StrUtil, PICInterface } from '@magic-xpa/utils';
12
12
  import { filter, map, debounceTime } from 'rxjs/operators';
@@ -17,20 +17,15 @@ import { HttpClient, HttpClientModule } from '@angular/common/http';
17
17
  import { NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
18
18
  import { Platform } from '@angular/cdk/platform';
19
19
 
20
- /**
21
- * @ignore
22
- */
23
20
  class ControlMetadata {
24
21
  constructor() {
25
22
  this.properties = new Map();
26
23
  this.classesMap = new Map();
27
24
  this.stylesMap = new Map();
28
- // user properties
29
25
  this.userProperties = new Map();
30
26
  this.customValidators = new Map();
31
27
  }
32
28
  setClass(key, value) {
33
- // for no-control - hold the name of the class to be removed later
34
29
  if (this.classesMap.has(key)) {
35
30
  this.removedClass = this.classesMap.get(key);
36
31
  }
@@ -45,14 +40,9 @@ class ControlMetadata {
45
40
  this.stylesMap.set(key, value);
46
41
  }
47
42
  }
48
- /**
49
- * @ignore
50
- */
51
43
  class ControlsMetadata {
52
44
  constructor() {
53
- //values of control
54
45
  this.values = new Map();
55
- // dictionary of controls with there properties
56
46
  this.ControlsProperties = new Map();
57
47
  this.isCreated = false;
58
48
  this.isEditing = false;
@@ -66,8 +56,6 @@ class ControlsMetadata {
66
56
  return this.ControlsProperties.get(controlId);
67
57
  }
68
58
  update(obj) {
69
- //should we keep the values here ?
70
- //this.values = obj.ControlsValues;
71
59
  let props = obj.ControlsMetaData;
72
60
  for (let controlName in props) {
73
61
  if (!this.ControlsProperties.has(controlName))
@@ -96,16 +84,13 @@ class ControlsMetadata {
96
84
  return this.values.get(controlName);
97
85
  }
98
86
  }
99
- /**
100
- * @ignore
101
- */
102
87
  class Records {
103
88
  constructor() {
104
89
  this.data = new Map();
105
- this.list = []; //used for sequential access in table
90
+ this.list = [];
106
91
  this.recordsBeforeCurrentView = 0;
107
92
  this.isEmptyDataView = false;
108
- this.sizeUpdated = false; //used for evaluating the RecordsSizeChange.
93
+ this.sizeUpdated = false;
109
94
  }
110
95
  getRow(dvRowId) {
111
96
  return this.list[dvRowId + this.recordsBeforeCurrentView];
@@ -129,24 +114,14 @@ class Records {
129
114
  }
130
115
  return false;
131
116
  }
132
- /*
133
- * for row editing
134
- * */
135
117
  startRowEditing(guiRowId) {
136
118
  if (guiRowId < this.list.length && this.data.has(guiRowId))
137
119
  this.data.get(guiRowId).isEditing = true;
138
120
  }
139
- /*
140
- * stop row editing on row Id
141
- * */
142
121
  stopRowEditing(guiRowId) {
143
122
  if (guiRowId < this.list.length && this.data.has(guiRowId))
144
123
  this.data.get(guiRowId).isEditing = false;
145
124
  }
146
- /*
147
- * return if row is in editing
148
- * Called by the HTML code, so parameter is a string, not a numebr
149
- * */
150
125
  isRowInRowEditing(guiRowId) {
151
126
  if (+guiRowId < this.list.length) {
152
127
  if (!this.data.has(+guiRowId) || isNullOrUndefined(this.data.get(+guiRowId)))
@@ -175,7 +150,6 @@ class Records {
175
150
  updateSize(len) {
176
151
  if (this.list.length != len) {
177
152
  if (len < this.list.length) {
178
- //remove rows
179
153
  for (let i = len; i < this.list.length; i++) {
180
154
  this.data.delete(i);
181
155
  }
@@ -184,10 +158,6 @@ class Records {
184
158
  this.sizeUpdated = true;
185
159
  }
186
160
  }
187
- /**
188
- * crears data for the first record
189
- * @param template
190
- */
191
161
  clearFirstTableRecord(template) {
192
162
  if (this.list.length >= 1) {
193
163
  for (const key in template) {
@@ -218,9 +188,6 @@ class Records {
218
188
  return this.guiTopIndex;
219
189
  }
220
190
  }
221
- /**
222
- * @ignore
223
- */
224
191
  var HtmlClasses;
225
192
  (function (HtmlClasses) {
226
193
  HtmlClasses["Color"] = "color";
@@ -229,16 +196,11 @@ var HtmlClasses;
229
196
  HtmlClasses["HintColor"] = "hintcolor";
230
197
  })(HtmlClasses || (HtmlClasses = {}));
231
198
 
232
- /**
233
- * @ignore
234
- */
235
199
  class EngineMagicService {
236
200
  constructor() {
237
201
  this.magicBridge = MagicBridge;
238
202
  this.isStub = false;
239
- // true when user is logged in magic
240
203
  this.isLoggedIn = false;
241
- //TODO - unregister
242
204
  this.refreshDom = new Subject();
243
205
  this.interactiveCommands = new Subject();
244
206
  }
@@ -281,6 +243,9 @@ class EngineMagicService {
281
243
  GetControlPictureMask(taskId, controlName) {
282
244
  return this.magicBridge.GetControlPictureMask(taskId, controlName);
283
245
  }
246
+ GetFormattedValue(taskId, controlName, value) {
247
+ return this.magicBridge.GetFormattedValue(taskId, controlName, value);
248
+ }
284
249
  ValidateControlValue(taskId, controlName, value) {
285
250
  return this.magicBridge.ValidateControlValue(taskId, controlName, value);
286
251
  }
@@ -288,7 +253,6 @@ class EngineMagicService {
288
253
  return this.magicBridge.GetFldRanges(taskId, controlName);
289
254
  }
290
255
  saveData(data) {
291
- //this.magicBridge.saveData(data);
292
256
  }
293
257
  getIsLoggedIn() {
294
258
  return this.isLoggedIn;
@@ -303,24 +267,15 @@ class EngineMagicService {
303
267
  this.magicBridge.TerminateContextUsingFetchAPI();
304
268
  }
305
269
  }
306
- /** @nocollapse */ EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
307
- /** @nocollapse */ EngineMagicService.ɵprov = ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
308
- /*@__PURE__*/ (function () { ɵsetClassMetadata(EngineMagicService, [{
270
+ EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
271
+ EngineMagicService.ɵprov = ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
272
+ (function () { ɵsetClassMetadata(EngineMagicService, [{
309
273
  type: Injectable
310
274
  }], null, null); })();
311
275
 
312
- /**
313
- * Manages the list of components in a project, and the project title
314
- */
315
276
  class ComponentListMagicService {
316
277
  constructor() {
317
- /**
318
- * Map of project components
319
- */
320
278
  this.components = new Map();
321
- /**
322
- * Map of project dialogs
323
- */
324
279
  this.dialogs = new Map();
325
280
  this.lazyLoadModulesMap = null;
326
281
  }
@@ -334,11 +289,6 @@ class ComponentListMagicService {
334
289
  data = this.components.get(name);
335
290
  return data;
336
291
  }
337
- /**
338
- * Return a component according to name
339
- * @param name Name of requested component
340
- * @returns The requested component
341
- */
342
292
  getComponent(name, mustHaveData = true) {
343
293
  let data = this.getData(name, mustHaveData);
344
294
  return data ? data.component : null;
@@ -349,29 +299,16 @@ class ComponentListMagicService {
349
299
  this.components.set(key, data);
350
300
  }
351
301
  }
352
- /**
353
- * Return a component according to name
354
- * @param name Name of requested component
355
- * @returns The requested component
356
- */
357
302
  getModuleRef(name) {
358
303
  let data = this.getData(name, false);
359
304
  return data ? data.moduleRef : null;
360
305
  ;
361
306
  }
362
- /**
363
- * Return the lazy load module details of the specified component
364
- * @param name: Name of requested component
365
- * @returns: lazy load module details
366
- */
367
307
  getLazyLoadModuleData(name) {
368
308
  return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
369
309
  }
370
310
  }
371
311
 
372
- /**
373
- * @ignore
374
- */
375
312
  class StylesMapManager {
376
313
  static magicValueGetStyle(styleName, magicValue) {
377
314
  let style = "";
@@ -398,12 +335,8 @@ StylesMapManager.MagicPropertyToHtmlAttributeMap = new Map([
398
335
  [MagicProperties.Wallpaper, "background-image"]
399
336
  ]);
400
337
 
401
- /**
402
- * @ignore
403
- */
404
338
  class GuiInteractiveExecutor {
405
339
  Run() {
406
- // Sets the currentContextID
407
340
  try {
408
341
  switch (this.command._commandType) {
409
342
  case InteractiveCommandType.GET_VALUE:
@@ -434,7 +367,6 @@ class GuiInteractiveExecutor {
434
367
  }
435
368
  catch (ex) {
436
369
  throw ex;
437
- //want to see all the exceptions for now
438
370
  }
439
371
  }
440
372
  static executeInteractiveCommand(task, guiIntactiveCommand, overlayService) {
@@ -511,21 +443,17 @@ BaseMagicOverlayContainer = __decorate([
511
443
  Output()
512
444
  ], BaseMagicOverlayContainer);
513
445
 
514
- /**
515
- * Directive for setting ViewContainerRef on element
516
- */
517
446
  class MagicViewContainerRef {
518
447
  constructor(vcRef, resolver) {
519
448
  this.vcRef = vcRef;
520
449
  this.resolver = resolver;
521
- // For angular 10 - find the component from the views
522
450
  let comp = (this.vcRef._hostView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
523
451
  comp.setViewContainerRef(vcRef);
524
452
  }
525
453
  }
526
- /** @nocollapse */ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentFactoryResolver)); };
527
- /** @nocollapse */ MagicViewContainerRef.ɵdir = ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
528
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicViewContainerRef, [{
454
+ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentFactoryResolver)); };
455
+ MagicViewContainerRef.ɵdir = ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
456
+ (function () { ɵsetClassMetadata(MagicViewContainerRef, [{
529
457
  type: Directive,
530
458
  args: [{
531
459
  selector: '[magicViewContainerRef]',
@@ -555,36 +483,16 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
555
483
  ɵɵadvance(2);
556
484
  ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
557
485
  } }
558
- /**
559
- * Creates a modal window for Magic modal window components
560
- */
561
486
  class MagicOverlayContainer extends BaseMagicOverlayContainer {
562
- /**
563
- *
564
- * @param injector
565
- * @param componentFactoryResolver
566
- */
567
487
  constructor(injector, componentFactoryResolver) {
568
488
  super();
569
489
  this.injector = injector;
570
490
  this.componentFactoryResolver = componentFactoryResolver;
571
- /**
572
- *
573
- */
574
491
  this.ModalComp = null;
575
- /**
576
- *
577
- */
578
492
  this.ModalCompParameters = {};
579
493
  this.onClose = new EventEmitter();
580
- /**
581
- *
582
- */
583
494
  this.componentRef = null;
584
495
  }
585
- /**
586
- *
587
- */
588
496
  ngOnInit() {
589
497
  const factory = this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);
590
498
  this.componentRef = this.modalbodyViewContainerRef.createComponent(factory);
@@ -593,10 +501,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
593
501
  setViewContainerRef(vcRef) {
594
502
  this.modalbodyViewContainerRef = vcRef;
595
503
  }
596
- /**
597
- * Returns the form name
598
- * @returns
599
- */
600
504
  getText() {
601
505
  if (this.componentRef !== null) {
602
506
  let comp = this.componentRef.instance;
@@ -605,10 +509,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
605
509
  else
606
510
  return "";
607
511
  }
608
- /**
609
- * Returns CSS styles for the window
610
- * @returns
611
- */
612
512
  getStyle() {
613
513
  let styles = {};
614
514
  if (this.componentRef != undefined) {
@@ -625,10 +525,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
625
525
  }
626
526
  return styles;
627
527
  }
628
- /**
629
- * Returns the CSS styles for the client area
630
- * @returns
631
- */
632
528
  getClientAreaStyles() {
633
529
  let styles = {};
634
530
  if (this.componentRef != undefined) {
@@ -644,33 +540,23 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
644
540
  }
645
541
  return styles;
646
542
  }
647
- /**
648
- * Should the title bar be displayed
649
- * @returns
650
- */
651
543
  getShowTitleBar() {
652
544
  if (this.componentRef != undefined) {
653
545
  let comp = this.componentRef.instance;
654
546
  return comp.ShowTitleBar();
655
547
  }
656
548
  }
657
- /**
658
- *
659
- */
660
549
  OnClose() {
661
550
  this.onClose.emit();
662
551
  }
663
- /**
664
- * Handles click in the background window
665
- */
666
552
  OnBackgroundClick() {
667
553
  let comp = this.componentRef.instance;
668
554
  if (comp.ShouldCloseOnBackgroundClick())
669
555
  this.OnClose();
670
556
  }
671
557
  }
672
- /** @nocollapse */ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver)); };
673
- /** @nocollapse */ MagicOverlayContainer.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
558
+ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver)); };
559
+ MagicOverlayContainer.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
674
560
  ɵɵviewQuery(_c0, true);
675
561
  ɵɵviewQuery(_c1, true);
676
562
  } if (rf & 2) {
@@ -700,7 +586,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
700
586
  ɵɵadvance(1);
701
587
  ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
702
588
  } }, directives: [NgIf, NgStyle, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{background-color:#fff}.modal-background[_ngcontent-%COMP%], .modal-foreground[_ngcontent-%COMP%]{bottom:0;left:0;position:fixed;right:0;top:0}.modal-background[_ngcontent-%COMP%]{background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"] });
703
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicOverlayContainer, [{
589
+ (function () { ɵsetClassMetadata(MagicOverlayContainer, [{
704
590
  type: Component,
705
591
  args: [{
706
592
  selector: 'app-magic-overlay-container',
@@ -737,44 +623,28 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
737
623
  type: Output
738
624
  }] }); })();
739
625
 
740
- /**
741
- * Service managing overlay windows
742
- * This is Magic's default provider
743
- */
744
626
  class OverlayContainerMagicProvider {
745
627
  getComponent() {
746
628
  return MagicOverlayContainer;
747
629
  }
748
630
  }
749
- /** @nocollapse */ OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
750
- /** @nocollapse */ OverlayContainerMagicProvider.ɵprov = ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
751
- /*@__PURE__*/ (function () { ɵsetClassMetadata(OverlayContainerMagicProvider, [{
631
+ OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
632
+ OverlayContainerMagicProvider.ɵprov = ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
633
+ (function () { ɵsetClassMetadata(OverlayContainerMagicProvider, [{
752
634
  type: Injectable
753
635
  }], null, null); })();
754
636
 
755
- /**
756
- * This is a base class for the magic confirm components
757
- */
758
637
  class BaseMagicConfirmComponent {
759
638
  constructor() {
760
- /**
761
- * onClose Event - to be raised when the component is closed
762
- * should pass true when OK is pressed and false when cancel is pressed
763
- */
764
639
  this.onClose = new EventEmitter();
765
640
  }
766
- /**
767
- * raises close Event
768
- * @param result true when OK is pressed and false when cancel is pressed
769
- *
770
- */
771
641
  OnClose(result) {
772
642
  this.onClose.emit(result);
773
643
  }
774
644
  }
775
- /** @nocollapse */ BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
776
- /** @nocollapse */ BaseMagicConfirmComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, styles: [""] });
777
- /*@__PURE__*/ (function () { ɵsetClassMetadata(BaseMagicConfirmComponent, [{
645
+ BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
646
+ BaseMagicConfirmComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, styles: [""] });
647
+ (function () { ɵsetClassMetadata(BaseMagicConfirmComponent, [{
778
648
  type: Component,
779
649
  args: [{
780
650
  selector: 'mg-base-alert',
@@ -789,27 +659,17 @@ class BaseMagicConfirmComponent {
789
659
  type: Output
790
660
  }] }); })();
791
661
 
792
- /**
793
- * This is a base class for the magic alert components
794
- */
795
662
  class BaseMagicAlertComponent {
796
663
  constructor() {
797
- /**
798
- * onClose Event - to be raised when the component is closed
799
-
800
- */
801
664
  this.onClose = new EventEmitter();
802
665
  }
803
- /**
804
- * close magic alert
805
- */
806
666
  OnClose() {
807
667
  this.onClose.emit();
808
668
  }
809
669
  }
810
- /** @nocollapse */ BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
811
- /** @nocollapse */ BaseMagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, styles: [""] });
812
- /*@__PURE__*/ (function () { ɵsetClassMetadata(BaseMagicAlertComponent, [{
670
+ BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
671
+ BaseMagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, styles: [""] });
672
+ (function () { ɵsetClassMetadata(BaseMagicAlertComponent, [{
813
673
  type: Component,
814
674
  args: [{
815
675
  selector: 'mg-base-alert',
@@ -824,9 +684,6 @@ class BaseMagicAlertComponent {
824
684
  type: Output
825
685
  }] }); })();
826
686
 
827
- /**
828
- * Directive for setting focus on element
829
- */
830
687
  class MagicFocusDirective {
831
688
  constructor(hostElement) {
832
689
  this.hostElement = hostElement;
@@ -835,9 +692,9 @@ class MagicFocusDirective {
835
692
  this.hostElement.nativeElement.focus();
836
693
  }
837
694
  }
838
- /** @nocollapse */ MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(ɵɵdirectiveInject(ElementRef)); };
839
- /** @nocollapse */ MagicFocusDirective.ɵdir = ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
840
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicFocusDirective, [{
695
+ MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(ɵɵdirectiveInject(ElementRef)); };
696
+ MagicFocusDirective.ɵdir = ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
697
+ (function () { ɵsetClassMetadata(MagicFocusDirective, [{
841
698
  type: Directive,
842
699
  args: [{
843
700
  selector: '[magicFocus]'
@@ -846,29 +703,16 @@ class MagicFocusDirective {
846
703
 
847
704
  const _c0$1 = ["overlayContainerWrapper"];
848
705
  class MagicOverlayContainerWrapper {
849
- /**
850
- *
851
- * @param componentFactoryResolver
852
- */
853
706
  constructor(componentListMagicService, loader, injector, componentFactoryResolver, changeDetectorRef) {
854
707
  this.componentListMagicService = componentListMagicService;
855
708
  this.loader = loader;
856
709
  this.injector = injector;
857
710
  this.componentFactoryResolver = componentFactoryResolver;
858
711
  this.changeDetectorRef = changeDetectorRef;
859
- /**
860
- *
861
- */
862
712
  this.Component = null;
863
- /**
864
- *
865
- */
866
713
  this.Parameters = {};
867
714
  this.onClose = new EventEmitter();
868
715
  }
869
- /**
870
- *
871
- */
872
716
  ngOnInit() {
873
717
  let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
874
718
  if (moduleRef == null) {
@@ -918,17 +762,13 @@ class MagicOverlayContainerWrapper {
918
762
  this.changeDetectorRef.detectChanges();
919
763
  }
920
764
  }
921
- /**
922
- * @ignore
923
- * contais data of allowed base components to use
924
- */
925
765
  MagicOverlayContainerWrapper.allowedBaseComps = new Map([
926
766
  [OverlayType.Overlay, { comp: BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
927
767
  [OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
928
768
  [OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
929
769
  ]);
930
- /** @nocollapse */ MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(NgModuleFactoryLoader), ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ChangeDetectorRef)); };
931
- /** @nocollapse */ MagicOverlayContainerWrapper.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
770
+ MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(NgModuleFactoryLoader), ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ChangeDetectorRef)); };
771
+ MagicOverlayContainerWrapper.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
932
772
  ɵɵstaticViewQuery(_c0$1, true);
933
773
  } if (rf & 2) {
934
774
  var _t;
@@ -942,7 +782,7 @@ MagicOverlayContainerWrapper.allowedBaseComps = new Map([
942
782
  ɵɵelement(6, "div", 5);
943
783
  ɵɵelementEnd();
944
784
  } }, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }"] });
945
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
785
+ (function () { ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
946
786
  type: Component,
947
787
  args: [{
948
788
  selector: 'app-magic-overlay-container-wrapper',
@@ -981,13 +821,10 @@ MagicOverlayContainerWrapper.allowedBaseComps = new Map([
981
821
  args: ['overlayContainerWrapper', { static: true }]
982
822
  }] }); })();
983
823
 
984
- /***
985
- * This is sample component for the alert message
986
- */
987
824
  class MagicAlertComponent extends BaseMagicAlertComponent {
988
825
  }
989
- /** @nocollapse */ MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
990
- /** @nocollapse */ MagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
826
+ MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
827
+ MagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
991
828
  ɵɵelementStart(0, "div");
992
829
  ɵɵelementStart(1, "div", 0);
993
830
  ɵɵelementStart(2, "h2");
@@ -1008,8 +845,8 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
1008
845
  ɵɵadvance(2);
1009
846
  ɵɵtextInterpolate1("", ctx.message, " ");
1010
847
  } }, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }"] });
1011
- const ɵMagicAlertComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(MagicAlertComponent);
1012
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicAlertComponent, [{
848
+ const ɵMagicAlertComponent_BaseFactory = ɵɵgetInheritedFactory(MagicAlertComponent);
849
+ (function () { ɵsetClassMetadata(MagicAlertComponent, [{
1013
850
  type: Component,
1014
851
  args: [{
1015
852
  selector: 'sample-magic-alert-component',
@@ -1053,13 +890,10 @@ const ɵMagicAlertComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(
1053
890
  }]
1054
891
  }], null, null); })();
1055
892
 
1056
- /***
1057
- * This is sample component for the confirmation box
1058
- */
1059
893
  class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
1060
894
  }
1061
- /** @nocollapse */ MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
1062
- /** @nocollapse */ MagicConfirmationBoxComponent.ɵcmp = ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) { if (rf & 1) {
895
+ MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
896
+ MagicConfirmationBoxComponent.ɵcmp = ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) { if (rf & 1) {
1063
897
  ɵɵelementStart(0, "div");
1064
898
  ɵɵelementStart(1, "div", 0);
1065
899
  ɵɵelementStart(2, "h2");
@@ -1084,8 +918,8 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
1084
918
  ɵɵadvance(1);
1085
919
  ɵɵtextInterpolate1(" ", ctx.message, " ");
1086
920
  } }, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel[_ngcontent-%COMP%] {\n background-color: #C1C1C1;\n }"] });
1087
- const ɵMagicConfirmationBoxComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
1088
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
921
+ const ɵMagicConfirmationBoxComponent_BaseFactory = ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
922
+ (function () { ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
1089
923
  type: Component,
1090
924
  args: [{
1091
925
  selector: 'sample-magic-confirmation-box',
@@ -1136,52 +970,25 @@ const ɵMagicConfirmationBoxComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInherit
1136
970
  }]
1137
971
  }], null, null); })();
1138
972
 
1139
- /**
1140
- * Service managing overlay windows
1141
- * This is Magic's default provider
1142
- */
1143
- /**
1144
- * Service managing alert and confirmation windows
1145
- * This is Magic's default provider
1146
- */
1147
973
  class ConfirmationComponentsMagicProvider {
1148
- /**
1149
- * Return true when use default javascript alert and confirmation or return false to provide custom components
1150
- * @returns true is we want to use default javascript alert and confirmation
1151
- */
1152
974
  showDefaultConfirmations() {
1153
975
  return true;
1154
976
  }
1155
- /**
1156
- * Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
1157
- * @returns component that will replace javascript Alert
1158
- */
1159
977
  getAlertComponent() {
1160
978
  return MagicAlertComponent;
1161
979
  }
1162
- /**
1163
- * Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
1164
- * @returns component that will replace javascript confirmation box
1165
- */
1166
980
  getConfirmtionComponent() {
1167
981
  return MagicConfirmationBoxComponent;
1168
982
  }
1169
983
  }
1170
- /** @nocollapse */ ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
1171
- /** @nocollapse */ ConfirmationComponentsMagicProvider.ɵprov = ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
1172
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
984
+ ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
985
+ ConfirmationComponentsMagicProvider.ɵprov = ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
986
+ (function () { ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
1173
987
  type: Injectable
1174
988
  }], null, null); })();
1175
989
 
1176
- /**
1177
- * Displays a message-box
1178
- */
1179
990
  class confirmationBox {
1180
- /**
1181
- * @ignore
1182
- */
1183
991
  static isConfirmBox(style) {
1184
- // button format mask is in first nibble from right
1185
992
  let buttonMode = style & 0x0F;
1186
993
  var isConfirm = (buttonMode === Styles.MSGBOX_BUTTON_OK_CANCEL) ||
1187
994
  (buttonMode === Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
@@ -1190,14 +997,7 @@ class confirmationBox {
1190
997
  (buttonMode === Styles.MSGBOX_BUTTON_RETRY_CANCEL);
1191
998
  return (isConfirm);
1192
999
  }
1193
- /**
1194
- * Converts the result from the HTML window to the expected result type
1195
- * @param style Result received from HTML window
1196
- * @param okWasPressed Was the "OK" pressed
1197
- * @returns MessageBox result type
1198
- */
1199
1000
  static convertToExcpectedResultBox(style, okWasPressed) {
1200
- // button format mask is in first nibble from right
1201
1001
  let buttonMode = style & 0x0F;
1202
1002
  let retValue = Styles.MSGBOX_RESULT_OK;
1203
1003
  if (buttonMode === Styles.MSGBOX_BUTTON_OK)
@@ -1214,19 +1014,10 @@ class confirmationBox {
1214
1014
  retValue = okWasPressed ? Styles.MSGBOX_RESULT_RETRY : Styles.MSGBOX_RESULT_CANCEL;
1215
1015
  return retValue;
1216
1016
  }
1217
- /**
1218
- * Show a message box as an HTML window
1219
- * @param title Title of the message box
1220
- * @param message Message that will be display in the message box
1221
- * @param style Style that include buttons \ Icons
1222
- * @returns MessageBox result
1223
- */
1224
1017
  static showConfirmationBox(title, message, style) {
1225
1018
  let okWasPressed = false;
1226
1019
  let retValue = Styles.MSGBOX_RESULT_OK;
1227
- // check if it is confirmation box
1228
1020
  let isConfirm = this.isConfirmBox(style);
1229
- // the title will be added to the string and we will add new line after the title
1230
1021
  let titleAndString = title + '\n' + '\n' + message;
1231
1022
  if (isConfirm)
1232
1023
  okWasPressed = confirm(titleAndString);
@@ -1234,14 +1025,10 @@ class confirmationBox {
1234
1025
  alert(titleAndString);
1235
1026
  okWasPressed = true;
1236
1027
  }
1237
- // return the result from the user
1238
1028
  return okWasPressed;
1239
1029
  }
1240
1030
  }
1241
1031
 
1242
- /**
1243
- * Service managing overlay windows
1244
- */
1245
1032
  class OverlayWindowService {
1246
1033
  constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1247
1034
  this.componentFactoryResolver = componentFactoryResolver;
@@ -1256,7 +1043,6 @@ class OverlayWindowService {
1256
1043
  this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
1257
1044
  }
1258
1045
  open(formName, taskId, taskDescription) {
1259
- // for overlay which are lazy loaded don't find data in component-list
1260
1046
  let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
1261
1047
  let parameters = { taskIdParam: taskId, taskDescription: taskDescription };
1262
1048
  let componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), OverlayType.Overlay);
@@ -1267,27 +1053,18 @@ class OverlayWindowService {
1267
1053
  });
1268
1054
  }
1269
1055
  close(commandStr) {
1270
- // Close the overlay by removing the overlay window from its container
1271
1056
  this.overlayWindowsContainerViewRef.remove();
1272
1057
  this.overlayWindowFocusManager.popDialog();
1273
1058
  let guiEvent1 = getGuiEventObj("dispose", null, 0);
1274
1059
  guiEvent1.TaskID = commandStr;
1275
1060
  this.engineMagicService.insertEvent(guiEvent1);
1276
1061
  }
1277
- /**
1278
- * Open Confirmation box
1279
- * @param title title of the box
1280
- * @param msg message
1281
- * @param style Magic style
1282
- */
1283
1062
  openConfirmationBox(title, msg, style) {
1284
- //show default confirmations
1285
1063
  if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
1286
1064
  let res = confirmationBox.showConfirmationBox(title, msg, style);
1287
1065
  this.finishConfirmation(style, res);
1288
1066
  }
1289
1067
  else {
1290
- //show custom confirmations
1291
1068
  let comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
1292
1069
  let overlayType = confirmationBox.isConfirmBox(style) ? OverlayType.ConfirmationBox : OverlayType.Alert;
1293
1070
  let componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
@@ -1298,21 +1075,11 @@ class OverlayWindowService {
1298
1075
  });
1299
1076
  }
1300
1077
  }
1301
- /**
1302
- * This method is called on close of the confirmation
1303
- * @param style Magic style
1304
- * @param result
1305
- */
1306
1078
  finishConfirmation(style, result) {
1307
1079
  let guiEvent = getGuiEventObj("confirmationClosed", null, 0);
1308
1080
  guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
1309
1081
  this.engineMagicService.insertEvent(guiEvent);
1310
1082
  }
1311
- /**
1312
- * creates a modal component. Can be used for overlay, message box or confirmation box
1313
- * @param parameters component's parameters
1314
- * @param component components to create
1315
- */
1316
1083
  createModalComponent(parameters, component, overlayType) {
1317
1084
  let componentRef;
1318
1085
  let magicModalContainerParameters = {
@@ -1320,20 +1087,18 @@ class OverlayWindowService {
1320
1087
  Parameters: parameters,
1321
1088
  OverlayTypeParam: overlayType
1322
1089
  };
1323
- // Create the UI component of modal window
1324
1090
  const factory = this.componentFactoryResolver.resolveComponentFactory(MagicOverlayContainerWrapper);
1325
1091
  let viewCRef = this.overlayWindowsContainerViewRef;
1326
1092
  componentRef = viewCRef.createComponent(factory);
1327
- // Set the data to newly created component
1328
1093
  Object.assign(componentRef.instance, magicModalContainerParameters);
1329
1094
  this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
1330
1095
  componentRef.instance.DetectChanges();
1331
1096
  return componentRef;
1332
1097
  }
1333
1098
  }
1334
- /** @nocollapse */ OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(ɵɵinject(ComponentFactoryResolver), ɵɵinject(ComponentListMagicService), ɵɵinject(EngineMagicService), ɵɵinject(OverlayContainerMagicProvider), ɵɵinject(ConfirmationComponentsMagicProvider)); };
1335
- /** @nocollapse */ OverlayWindowService.ɵprov = ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
1336
- /*@__PURE__*/ (function () { ɵsetClassMetadata(OverlayWindowService, [{
1099
+ OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(ɵɵinject(ComponentFactoryResolver), ɵɵinject(ComponentListMagicService), ɵɵinject(EngineMagicService), ɵɵinject(OverlayContainerMagicProvider), ɵɵinject(ConfirmationComponentsMagicProvider)); };
1100
+ OverlayWindowService.ɵprov = ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
1101
+ (function () { ɵsetClassMetadata(OverlayWindowService, [{
1337
1102
  type: Injectable
1338
1103
  }], function () { return [{ type: ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
1339
1104
  class OverlayWindowFocusManager {
@@ -1454,95 +1219,37 @@ class DialogInfo {
1454
1219
  }
1455
1220
  }
1456
1221
 
1457
- /**
1458
- * Main service to connect the UI with the Magic WebCLient
1459
- */
1460
1222
  class TaskMagicService {
1461
- /**
1462
- *
1463
- * @param magic
1464
- */
1465
1223
  constructor(magic, overlayWindowService) {
1466
1224
  this.magic = magic;
1467
1225
  this.overlayWindowService = overlayWindowService;
1468
- /**
1469
- * Collection of data for all controls
1470
- */
1471
1226
  this.Records = new Records();
1472
- /**
1473
- * FormGroup collection for line mode
1474
- */
1475
1227
  this.formGroups = [];
1476
- /**
1477
- * @ignore
1478
- */
1479
1228
  this.refreshDom = new Subject();
1480
- /**
1481
- * @ignore
1482
- */
1483
1229
  this.detectChanges = new Subject();
1484
- /**
1485
- * @ignore
1486
- */
1487
1230
  this.interactiveCommands = new Subject();
1488
- /**
1489
- * @ignore
1490
- * This event is emitted when the selected row in a table changes.
1491
- */
1492
1231
  this.OnSelectedRowChanged = new EventEmitter();
1493
- /**
1494
- * @ignore
1495
- */
1496
1232
  this.customPropertiesSubject = new Subject();
1497
- /**
1498
- * @ignore
1499
- */
1500
1233
  this.recordsCountChangeSubject = new Subject();
1501
- /**
1502
- * @ignore
1503
- */
1504
1234
  this.oldPageSize = 0;
1505
1235
  this.Records.setGuiTopIndex(0);
1506
1236
  this.mgInputDateFormat = null;
1507
1237
  }
1508
- /**
1509
- * returns true if used is logged in
1510
- * @returns
1511
- */
1512
1238
  getIsLoggenIn() {
1513
1239
  return this.magic.getIsLoggedIn();
1514
1240
  }
1515
- /**
1516
- * returns the task Id
1517
- * @returns
1518
- */
1519
1241
  get taskId() {
1520
1242
  return this._taskId;
1521
1243
  }
1522
- /**
1523
- * Sets the task Id
1524
- * @param value the task id to set
1525
- */
1526
1244
  set taskId(value) {
1527
- // debugger;
1528
1245
  this._taskId = value;
1529
1246
  }
1530
- /**
1531
- * Returns the task's data in Screen mode
1532
- * @returns
1533
- */
1534
1247
  get ScreenControlsData() {
1535
1248
  return this.Records.list['0'];
1536
1249
  }
1537
- /**
1538
- * @ignore
1539
- */
1540
1250
  settemplate(value) {
1541
1251
  this.template = value;
1542
1252
  }
1543
- /**
1544
- * Builds the FormControl for each and every control
1545
- */
1546
1253
  buildScreenModeControls() {
1547
1254
  const group = new FormGroup({});
1548
1255
  for (const key in this.template) {
@@ -1554,21 +1261,10 @@ class TaskMagicService {
1554
1261
  }
1555
1262
  this.ScreenModeControls = group;
1556
1263
  }
1557
- /**
1558
- * Is the control a table control
1559
- * @param id Id of the control
1560
- * @returns
1561
- */
1562
1264
  isTableControl(id) {
1563
1265
  return this.template[id] == '1';
1564
1266
  }
1565
1267
  getMgInputDateFormat() { return this.mgInputDateFormat; }
1566
- /**
1567
- * Returns the FormControl of a control
1568
- * @param guiRowid Id of the requested row
1569
- * @param id Id of the control
1570
- * @returns
1571
- */
1572
1268
  getFormControl(guiRowid, id) {
1573
1269
  let c;
1574
1270
  let group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
@@ -1578,21 +1274,12 @@ class TaskMagicService {
1578
1274
  }
1579
1275
  return c;
1580
1276
  }
1581
- /**
1582
- * handle the change of text for input control inside table
1583
- * @param guiRowId Id of the row for which the FormControls are built
1584
- * set the new value of the formcontrol
1585
- */
1586
1277
  setInputTextValue(controlId, guiRowid, val) {
1587
1278
  this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
1588
1279
  const fc = this.getFormControl(guiRowid, controlId);
1589
1280
  if (!isNullOrUndefined(val))
1590
1281
  fc.setValue(val);
1591
1282
  }
1592
- /**
1593
- * Build the FormControls for a table row
1594
- * @param guiRowId Id of the row for which the FormControls are built
1595
- */
1596
1283
  buildTableRowControls(guiRowId) {
1597
1284
  const group = new FormGroup({});
1598
1285
  for (const key in this.template) {
@@ -1604,58 +1291,30 @@ class TaskMagicService {
1604
1291
  }
1605
1292
  this.formGroups[guiRowId] = group;
1606
1293
  }
1607
- /**
1608
- *
1609
- * @ignore
1610
- */
1611
1294
  updateRecordsBeforeCurrentView(value) {
1612
1295
  this.Records.recordsBeforeCurrentView = value;
1613
1296
  }
1614
- /**
1615
- * @ignore
1616
- */
1617
1297
  setIncludesFirst(value) {
1618
1298
  this.Records.includesFirst = value;
1619
1299
  }
1620
- /**
1621
- * @ignore
1622
- */
1623
1300
  setIncludesLast(value) {
1624
1301
  this.Records.includesLast = value;
1625
1302
  }
1626
- /**
1627
- * @ignore
1628
- */
1629
1303
  markRowAsCreated(guiRowId) {
1630
1304
  this.Records.markRowAsCreated(guiRowId);
1631
1305
  }
1632
- /**
1633
- * @ignore
1634
- */
1635
1306
  markRowAsNotCreated(guiRowId) {
1636
1307
  this.Records.markRowAsNotCreated(guiRowId);
1637
1308
  }
1638
- /**
1639
- * @ignore
1640
- */
1641
1309
  startRowEditing(guiRowId) {
1642
1310
  this.Records.startRowEditing(guiRowId);
1643
1311
  }
1644
- /**
1645
- * @ignore
1646
- */
1647
1312
  stopRowEditing(guiRowId) {
1648
1313
  this.Records.stopRowEditing(guiRowId);
1649
1314
  }
1650
- /**
1651
- * @ignore
1652
- */
1653
1315
  isRowInRowEditing(guiRowId) {
1654
1316
  return this.Records.isRowInRowEditing(guiRowId);
1655
1317
  }
1656
- /**
1657
- * @ignore
1658
- */
1659
1318
  setIsEmptyDataView(isEmpty) {
1660
1319
  if (this.Records.isEmptyDataView !== isEmpty) {
1661
1320
  if (isEmpty)
@@ -1665,11 +1324,6 @@ class TaskMagicService {
1665
1324
  this.refreshView();
1666
1325
  }
1667
1326
  }
1668
- /**
1669
- * Initialize the service to work with the task
1670
- * @param taskId Id of the task
1671
- * @param taskDescription
1672
- */
1673
1327
  initTask(taskId, taskDescription) {
1674
1328
  this.Records.createFirst();
1675
1329
  this.oldPageSize = 0;
@@ -1681,71 +1335,39 @@ class TaskMagicService {
1681
1335
  this.settemplate(taskDescription);
1682
1336
  }
1683
1337
  this.buildScreenModeControls();
1684
- // remove previous subscriptions
1685
1338
  if (!isNullOrUndefined(this.subscribeRefreshDom))
1686
1339
  this.subscribeRefreshDom.unsubscribe();
1687
1340
  if (!isNullOrUndefined(this.subscribeInteractiveCommands))
1688
1341
  this.subscribeInteractiveCommands.unsubscribe();
1689
1342
  this.subscribeRefreshDom = this.magic.refreshDom.pipe(filter(command => command.TaskTag === this.taskId))
1690
1343
  .subscribe(command => {
1691
- // console.log("Task " + command.TaskTag + "command " + command.CommandType);
1692
1344
  this.executeCommand(command);
1693
1345
  });
1694
1346
  this.subscribeInteractiveCommands = this.magic.interactiveCommands
1695
1347
  .pipe(filter(command => command.TaskTag === this.taskId))
1696
1348
  .subscribe(command => {
1697
- // console.log("Task " + command.TaskTag + "command " + command.CommandType);
1698
1349
  this.executeInteractiveCommand(command);
1699
1350
  });
1700
1351
  }
1701
- /**
1702
- * @ignore
1703
- */
1704
1352
  refreshView() {
1705
1353
  this.detectChanges.next('');
1706
1354
  }
1707
- /**
1708
- * Insert an event to the Magic WebClient event queue
1709
- * @param guiEvent The event to insert
1710
- */
1711
1355
  insertEvent(guiEvent) {
1712
1356
  guiEvent.TaskID = this.taskId;
1713
1357
  this.magic.insertEvent(guiEvent);
1714
1358
  }
1715
- /**
1716
- * @ignore
1717
- */
1718
1359
  GetControlPictureMask(controlName) {
1719
1360
  return this.magic.GetControlPictureMask(this.taskId, controlName);
1720
1361
  }
1721
- /**
1722
- * Validates the control value, using the Magic WebClient
1723
- * @param controlName Id of validated control
1724
- * @param value value to be validated
1725
- * @returns If validation fails, returns error message, else returns null
1726
- */
1727
1362
  ValidateControlValue(controlName, value) {
1728
1363
  return this.magic.ValidateControlValue(this.taskId, controlName, value);
1729
1364
  }
1730
- /**
1731
- * @ignore
1732
- */
1733
1365
  GetRangedValue(controlName, value) {
1734
1366
  return this.magic.GetRangedValue(this.taskId, controlName, value);
1735
1367
  }
1736
- /**
1737
- * @ignore
1738
- */
1739
1368
  GetFldRanges(controlName) {
1740
1369
  return this.magic.GetFldRanges(this.taskId, controlName);
1741
1370
  }
1742
- /**
1743
- * returns the value of a property of the control
1744
- * @param controlId Id of control
1745
- * @param prop Property
1746
- * @param guiRowId Row Id, if applicable
1747
- * @returns Property value
1748
- */
1749
1371
  getProperty(controlId, prop, guiRowId) {
1750
1372
  if (isNullOrUndefined(guiRowId))
1751
1373
  guiRowId = '0';
@@ -1759,9 +1381,6 @@ class TaskMagicService {
1759
1381
  return this.Records.list[guiRowId].getProperty(controlId, prop);
1760
1382
  }
1761
1383
  }
1762
- /**
1763
- * @ignore
1764
- */
1765
1384
  getPropertyStub(ControlsProperties, controlId, prop) {
1766
1385
  ControlsProperties = ControlsProperties.ControlsProperties;
1767
1386
  if (controlId in ControlsProperties) {
@@ -1771,31 +1390,15 @@ class TaskMagicService {
1771
1390
  }
1772
1391
  return '';
1773
1392
  }
1774
- /**
1775
- * @ignore
1776
- */
1777
1393
  getStyleStub(ControlsProperties, controlId, styleName) {
1778
1394
  ControlsProperties = ControlsProperties.ControlsProperties;
1779
1395
  return ControlsProperties[controlId].stylesMap.get(styleName);
1780
1396
  }
1781
- /**
1782
- * Return the CSS classes used for this control
1783
- * @param controlId Id of control
1784
- * @param guiRowId Row Id, if applicable
1785
- * @returns String containing the classes currently defined for this control
1786
- */
1787
1397
  getClasses(controlId, guiRowId) {
1788
1398
  if (isNullOrUndefined(guiRowId))
1789
1399
  guiRowId = '0';
1790
1400
  return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
1791
1401
  }
1792
- /**
1793
- * Return the value of a style used for a control
1794
- * @param controlId Id of control
1795
- * @param styleName Name of style
1796
- * @param guiRowId Row Id, if applicable
1797
- * @returns value of style of the control
1798
- */
1799
1402
  getStyle(controlId, styleName, guiRowId) {
1800
1403
  if (isNullOrUndefined(guiRowId))
1801
1404
  guiRowId = '0';
@@ -1806,36 +1409,21 @@ class TaskMagicService {
1806
1409
  return StylesMapManager.magicValueGetStyle(styleName, magicValue);
1807
1410
  }
1808
1411
  }
1809
- /**
1810
- * Return the value of a control
1811
- * @param controlId Id of control
1812
- * @param guiRowId Row Id, if applicable
1813
- * @returns value of the control
1814
- */
1815
1412
  getValue(controlId, guiRowId) {
1816
1413
  if (isNullOrUndefined(guiRowId))
1817
1414
  guiRowId = '0';
1818
1415
  return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
1819
1416
  }
1820
- /**
1821
- * Sets the value of a control
1822
- * @param controlId Id of control
1823
- * @param guiRowId Row Id, if applicable
1824
- * @param value Value to set
1825
- */
1417
+ getFormattedValue(controlName, val) {
1418
+ return this.magic.GetFormattedValue(this.taskId, controlName, val);
1419
+ }
1826
1420
  setValue(controlId, guiRowId, value) {
1827
1421
  return this.Records.list[guiRowId].setValue(controlId, value);
1828
1422
  }
1829
- /**
1830
- * @ignore
1831
- */
1832
1423
  executeInteractiveCommand(guiInteractiveCommand) {
1833
1424
  GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
1834
1425
  this.interactiveCommands.next(guiInteractiveCommand);
1835
1426
  }
1836
- /**
1837
- * @ignore
1838
- */
1839
1427
  handleSetProperty(command, isTableChild) {
1840
1428
  let controlId = command.CtrlName;
1841
1429
  let dvRowId = (command.line || 0);
@@ -1872,7 +1460,6 @@ class TaskMagicService {
1872
1460
  let controlId = command.CtrlName;
1873
1461
  let properties;
1874
1462
  let isTableChild = this.isTableControl(controlId);
1875
- // For non-input type controls on table.
1876
1463
  if (command.obj !== null)
1877
1464
  isTableChild = isTableChild || command.obj.IsTableChild;
1878
1465
  guiRowId = this.getGuiRowId(dvRowId, isTableChild);
@@ -1923,13 +1510,13 @@ class TaskMagicService {
1923
1510
  break;
1924
1511
  case CommandType.SET_PROPERTY:
1925
1512
  this.handleSetProperty(command, isTableChild);
1513
+ if (command.Operation == HtmlProperties.ReadOnly)
1514
+ this.refreshDom.next(command);
1926
1515
  break;
1927
1516
  case CommandType.PROP_SET_USER_PROPERTY:
1928
1517
  properties = this.Records.list[guiRowId].getControlMetadata(controlId);
1929
- // if the property has changed, set the property and raise the subject
1930
1518
  if (properties.userProperties.get(command.Operation) !== command.obj1) {
1931
1519
  properties.userProperties.set(command.Operation, command.obj1);
1932
- // the property name is of format <controlName>~<propertyName>
1933
1520
  this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
1934
1521
  }
1935
1522
  break;
@@ -1974,12 +1561,11 @@ class TaskMagicService {
1974
1561
  case CommandType.SET_EMPTY_DATAVIEW:
1975
1562
  this.setIsEmptyDataView(command.Bool1);
1976
1563
  break;
1564
+ case CommandType.SET_FOCUS:
1565
+ this.refreshDom.next(command);
1566
+ break;
1977
1567
  }
1978
- this.refreshDom.next(command);
1979
1568
  }
1980
- /**
1981
- custom validator
1982
- */
1983
1569
  customValidator(rowid, id) {
1984
1570
  return (control) => {
1985
1571
  let controlMetadata;
@@ -1993,13 +1579,6 @@ class TaskMagicService {
1993
1579
  return null;
1994
1580
  };
1995
1581
  }
1996
- /**
1997
- * COnvert a value from Magic format to native format
1998
- * @param controlId Id of control
1999
- * @param rowId Row Id, if applicable
2000
- * @param val Value to convert
2001
- * @returns Converted value
2002
- */
2003
1582
  ConvertValToNative(controlId, rowId, val) {
2004
1583
  let properties;
2005
1584
  properties = this.Records.list[0].getControlMetadata(controlId);
@@ -2048,13 +1627,6 @@ class TaskMagicService {
2048
1627
  return val;
2049
1628
  }
2050
1629
  }
2051
- /**
2052
- * Convert a value from native to Magic format
2053
- * @param controlId Id of control
2054
- * @param rowId Row Id, if applicable
2055
- * @param val Value to convert
2056
- * @returns Converted value
2057
- */
2058
1630
  ConvertValFromNative(controlId, rowId, val) {
2059
1631
  let properties;
2060
1632
  properties = this.Records.list[0].getControlMetadata(controlId);
@@ -2097,22 +1669,12 @@ class TaskMagicService {
2097
1669
  return val;
2098
1670
  }
2099
1671
  }
2100
- /**
2101
- * Handle resize and also fetch chunk of records if having an empty view.
2102
- * @ignore
2103
- * @param pageSize : PageSize
2104
- * @param topGuiRowId : GuiRowId of first record in view.
2105
- */
2106
1672
  resize(pageSize, topGuiRowId) {
2107
1673
  let guiEvent = getGuiEventObj('resize', 'table', 0);
2108
1674
  guiEvent.PageSize = pageSize;
2109
- //As 'getRows' event also gets executed, set the guiEvent.Line parameter.
2110
1675
  guiEvent.Line = topGuiRowId;
2111
1676
  this.insertEvent(guiEvent);
2112
1677
  }
2113
- /**
2114
- * Fetches data for new table rows when scrolling done
2115
- */
2116
1678
  onScrollDown() {
2117
1679
  if (!this.Records.includesLast) {
2118
1680
  let guiEvent = getGuiEventObj('getRows', 'table', 0);
@@ -2120,29 +1682,15 @@ class TaskMagicService {
2120
1682
  this.insertEvent(guiEvent);
2121
1683
  }
2122
1684
  }
2123
- /**
2124
- * Sets the new browser window title
2125
- * @param newTitle New window title
2126
- */
2127
1685
  setTitle(newTitle) {
2128
1686
  this.mgTitleService.setTitle(newTitle);
2129
1687
  }
2130
- /**
2131
- * @ignore
2132
- */
2133
1688
  getGuiRowId(dvRowId, isTableControl) {
2134
1689
  return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
2135
1690
  }
2136
- /**
2137
- *
2138
- * @ignore
2139
- */
2140
1691
  getDvRowId(guiRowId) {
2141
1692
  return (guiRowId - this.Records.recordsBeforeCurrentView);
2142
1693
  }
2143
- /**
2144
- * Clean up the service when it is no longer needed
2145
- */
2146
1694
  dispose() {
2147
1695
  this.refreshDom.complete();
2148
1696
  this.detectChanges.complete();
@@ -2152,14 +1700,6 @@ class TaskMagicService {
2152
1700
  this.customPropertiesSubject.complete();
2153
1701
  this.OnSelectedRowChanged.complete();
2154
1702
  }
2155
- ///////////////////////////////
2156
- //Events:
2157
- /**
2158
- * Handle the Combobox "change" event
2159
- * @param event The event received from the UI
2160
- * @param idx Id of the control raising the event
2161
- * @param line Row Id, if applicable
2162
- */
2163
1703
  onComboboxSelectionChanged(event, idx, line) {
2164
1704
  let guiEvent = getGuiEventObj('selectionchanged', idx, line);
2165
1705
  if (typeof (event) == 'number') {
@@ -2178,11 +1718,6 @@ class TaskMagicService {
2178
1718
  }
2179
1719
  this.insertEvent(guiEvent);
2180
1720
  }
2181
- /**
2182
- * Handle the Listbox "change" event
2183
- * @param event The event received from the UI
2184
- * @param idx Id of the control raising the event
2185
- */
2186
1721
  onListBoxSelectionChanged(event, idx) {
2187
1722
  let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
2188
1723
  let selectedOptions;
@@ -2198,15 +1733,9 @@ class TaskMagicService {
2198
1733
  else
2199
1734
  indexes[i] = (selectedOptions[i]).value;
2200
1735
  }
2201
- guiEvent.Value = indexes; // TODO: fix
1736
+ guiEvent.Value = indexes;
2202
1737
  this.insertEvent(guiEvent);
2203
1738
  }
2204
- /**
2205
- * Handle the Checkbox "change" event
2206
- * @param event The event received from the UI
2207
- * @param idx Id of the control raising the event
2208
- * @param rowId Row Id, if applicable
2209
- */
2210
1739
  onCheckChanged(event, idx, rowId) {
2211
1740
  if (typeof rowId === 'undefined')
2212
1741
  rowId = 0;
@@ -2222,21 +1751,11 @@ class TaskMagicService {
2222
1751
  }
2223
1752
  this.insertEvent(guiEvent);
2224
1753
  }
2225
- /**
2226
- * Handle tab selection change, caused by UI events
2227
- * @param idx Id of the control raising the event
2228
- * @param layer Id of selected tabpage
2229
- */
2230
1754
  mgOnTabSelectionChanged(idx, layer) {
2231
1755
  let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
2232
1756
  guiEvent.Value = layer.toString();
2233
1757
  this.insertEvent(guiEvent);
2234
1758
  }
2235
- /**
2236
- * Handle the Radio button "change" event
2237
- * @param event The event received from the UI
2238
- * @param idx Id of the control raising the event
2239
- */
2240
1759
  mgOnRadioSelectionChanged(event, idx) {
2241
1760
  let result = this.getFormControl('0', idx);
2242
1761
  let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
@@ -2246,28 +1765,15 @@ class TaskMagicService {
2246
1765
  guiEvent.Value = result.value;
2247
1766
  this.insertEvent(guiEvent);
2248
1767
  }
2249
- /**
2250
- * Inserts the "close" event to the magic WebClient event queue
2251
- */
2252
1768
  close() {
2253
1769
  this.insertEvent(getGuiEventObj('close', null, 0));
2254
1770
  }
2255
- ///////////////////////////////
2256
- /**
2257
- * @ignore
2258
- */
2259
1771
  IsStub() {
2260
1772
  return this.magic.isStub;
2261
1773
  }
2262
- /**
2263
- * @ignore
2264
- */
2265
1774
  saveData(data) {
2266
1775
  this.magic.saveData(data);
2267
1776
  }
2268
- /**
2269
- * @ignore
2270
- */
2271
1777
  createData() {
2272
1778
  let myData = {
2273
1779
  records: this.Records,
@@ -2279,9 +1785,6 @@ class TaskMagicService {
2279
1785
  console.log(text);
2280
1786
  this.saveData(text);
2281
1787
  }
2282
- /**
2283
- * @ignore
2284
- */
2285
1788
  loadStubData(stubData) {
2286
1789
  this.Records = stubData.records;
2287
1790
  this.settemplate(stubData.template);
@@ -2289,15 +1792,9 @@ class TaskMagicService {
2289
1792
  for (let i = 0; i < this.Records.list.length; i++)
2290
1793
  this.buildTableRowControls(i);
2291
1794
  }
2292
- /**
2293
- * @ignore
2294
- */
2295
1795
  loadData() {
2296
1796
  alert('Please, overwrite method loadData');
2297
1797
  }
2298
- /**
2299
- * @ignore
2300
- */
2301
1798
  setStubValue(guiRowId, fc, name) {
2302
1799
  if (this.IsStub()) {
2303
1800
  try {
@@ -2309,15 +1806,12 @@ class TaskMagicService {
2309
1806
  }
2310
1807
  }
2311
1808
  }
2312
- /** @nocollapse */ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(ɵɵinject(EngineMagicService), ɵɵinject(OverlayWindowService)); };
2313
- /** @nocollapse */ TaskMagicService.ɵprov = ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
2314
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TaskMagicService, [{
1809
+ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(ɵɵinject(EngineMagicService), ɵɵinject(OverlayWindowService)); };
1810
+ TaskMagicService.ɵprov = ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
1811
+ (function () { ɵsetClassMetadata(TaskMagicService, [{
2315
1812
  type: Injectable
2316
1813
  }], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null); })();
2317
1814
 
2318
- /**
2319
- * @ignore
2320
- */
2321
1815
  class CommandsCollectorMagicService {
2322
1816
  constructor(magic) {
2323
1817
  this.magic = magic;
@@ -2349,20 +1843,14 @@ class CommandsCollectorMagicService {
2349
1843
  return commands;
2350
1844
  }
2351
1845
  }
2352
- /** @nocollapse */ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(ɵɵinject(EngineMagicService)); };
2353
- /** @nocollapse */ CommandsCollectorMagicService.ɵprov = ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
2354
- /*@__PURE__*/ (function () { ɵsetClassMetadata(CommandsCollectorMagicService, [{
1846
+ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(ɵɵinject(EngineMagicService)); };
1847
+ CommandsCollectorMagicService.ɵprov = ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
1848
+ (function () { ɵsetClassMetadata(CommandsCollectorMagicService, [{
2355
1849
  type: Injectable
2356
1850
  }], function () { return [{ type: EngineMagicService }]; }, null); })();
2357
1851
 
2358
- /**
2359
- * @ignore
2360
- */
2361
1852
  class RouteCommand {
2362
1853
  }
2363
- /**
2364
- * @ignore
2365
- */
2366
1854
  class RouterCommandsMagicService {
2367
1855
  constructor() {
2368
1856
  this.pendingRouteCommands = [];
@@ -2377,15 +1865,12 @@ class RouterCommandsMagicService {
2377
1865
  }
2378
1866
  }
2379
1867
  }
2380
- /** @nocollapse */ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
2381
- /** @nocollapse */ RouterCommandsMagicService.ɵprov = ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
2382
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RouterCommandsMagicService, [{
1868
+ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
1869
+ RouterCommandsMagicService.ɵprov = ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
1870
+ (function () { ɵsetClassMetadata(RouterCommandsMagicService, [{
2383
1871
  type: Injectable
2384
1872
  }], null, null); })();
2385
1873
 
2386
- /**
2387
- * Service for managing subforms and routing
2388
- */
2389
1874
  class SubformMagicService {
2390
1875
  constructor(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
2391
1876
  this.task = task;
@@ -2394,15 +1879,10 @@ class SubformMagicService {
2394
1879
  this.pendingCommandsCollector = pendingCommandsCollector;
2395
1880
  this.router = router;
2396
1881
  this.routerCommandsMagicService = routerCommandsMagicService;
2397
- this.subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
2398
- this.routesDict = {}; // dictionary of router outlet to router path
1882
+ this.subformsDict = {};
1883
+ this.routesDict = {};
2399
1884
  this.currentRouteDefinition = null;
2400
1885
  }
2401
- /**
2402
- * Finds and returns the component according to the subform name
2403
- * @param subformName
2404
- * @returns
2405
- */
2406
1886
  mgGetComp(subformName) {
2407
1887
  if (subformName in this.subformsDict) {
2408
1888
  let formName = this.subformsDict[subformName].formName;
@@ -2411,11 +1891,6 @@ class SubformMagicService {
2411
1891
  }
2412
1892
  return null;
2413
1893
  }
2414
- /**
2415
- * Returns the parameters of the subform
2416
- * @param subformName
2417
- * @returns
2418
- */
2419
1894
  mgGetParameters(subformName) {
2420
1895
  if (subformName in this.subformsDict) {
2421
1896
  return this.subformsDict[subformName].parameters;
@@ -2423,9 +1898,6 @@ class SubformMagicService {
2423
1898
  else
2424
1899
  return "";
2425
1900
  }
2426
- /**
2427
- * @ignore
2428
- */
2429
1901
  deleteSubformComp(subformControlName, formName) {
2430
1902
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2431
1903
  if (this.subformsDict[subformControlName].formName === formName) {
@@ -2434,13 +1906,10 @@ class SubformMagicService {
2434
1906
  }
2435
1907
  }
2436
1908
  }
2437
- /**
2438
- * @ignore
2439
- */
2440
1909
  addSubformComp(subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
2441
1910
  this.pendingCommandsCollector.startCollecting();
2442
1911
  let refreshNeeded = false;
2443
- if (isNullOrUndefined(routerPath)) { // call in destination subform
1912
+ if (isNullOrUndefined(routerPath)) {
2444
1913
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2445
1914
  if (this.subformsDict[subformControlName].formName === formName) {
2446
1915
  this.subformsDict[subformControlName] = {};
@@ -2451,10 +1920,9 @@ class SubformMagicService {
2451
1920
  formName,
2452
1921
  parameters: { taskIdParam: taskId, taskDescription: taskDescription }
2453
1922
  };
2454
- //this.ref.detectChanges();
2455
1923
  refreshNeeded = true;
2456
1924
  }
2457
- else { // call route
1925
+ else {
2458
1926
  if (inDefaultOutlet)
2459
1927
  subformControlName = "primary";
2460
1928
  let routeParams = new List();
@@ -2469,10 +1937,6 @@ class SubformMagicService {
2469
1937
  parameters: { taskIdParam: taskId, taskDescription: taskDescription },
2470
1938
  routeParams: routeParams
2471
1939
  };
2472
- // If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
2473
- // called once, but angular has not yet executed it (ngOnInit of the new component is not called).
2474
- // In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
2475
- // So, put a command in the queue which will be executed after the first one is executed.
2476
1940
  if (SubformMagicService.currentCallerMgSubformServiceRef === null)
2477
1941
  this.ExecuteRouteCommand(routeCommand);
2478
1942
  else
@@ -2481,16 +1945,11 @@ class SubformMagicService {
2481
1945
  if (refreshNeeded)
2482
1946
  this.task.refreshView();
2483
1947
  }
2484
- /**
2485
- * Open the subform using a route command
2486
- */
2487
1948
  ExecuteRouteCommand(routeCommand) {
2488
1949
  let reusingComponent = false;
2489
1950
  let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
2490
1951
  let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
2491
1952
  if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
2492
- // If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
2493
- // So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
2494
1953
  currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
2495
1954
  .then((result) => {
2496
1955
  SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
@@ -2530,12 +1989,7 @@ class SubformMagicService {
2530
1989
  }
2531
1990
  });
2532
1991
  }
2533
- /**
2534
- * @ignore
2535
- */
2536
1992
  init() {
2537
- // If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
2538
- // So, execute them now.
2539
1993
  const pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
2540
1994
  if (pendingCommands.length > 0) {
2541
1995
  pendingCommands.forEach(command => { this.task.executeCommand(command); });
@@ -2543,15 +1997,9 @@ class SubformMagicService {
2543
1997
  }
2544
1998
  this.pendingCommandsCollector.stopCollecting();
2545
1999
  }
2546
- /**
2547
- * @ignore
2548
- */
2549
2000
  refreshView() {
2550
2001
  this.task.refreshView();
2551
2002
  }
2552
- ///
2553
- // return the relative route
2554
- //
2555
2003
  static getRelativeRoute(sendActivatedRoute) {
2556
2004
  let currentActiveRoute = sendActivatedRoute;
2557
2005
  if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
@@ -2564,70 +2012,37 @@ class SubformMagicService {
2564
2012
  }
2565
2013
  SubformMagicService.currentCallerMgSubformServiceRef = null;
2566
2014
  SubformMagicService.routerContainers = new Array();
2567
- /** @nocollapse */ SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(ɵɵinject(TaskMagicService), ɵɵinject(ActivatedRoute), ɵɵinject(ComponentListMagicService), ɵɵinject(CommandsCollectorMagicService), ɵɵinject(Router), ɵɵinject(RouterCommandsMagicService)); };
2568
- /** @nocollapse */ SubformMagicService.ɵprov = ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
2569
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SubformMagicService, [{
2015
+ SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(ɵɵinject(TaskMagicService), ɵɵinject(ActivatedRoute), ɵɵinject(ComponentListMagicService), ɵɵinject(CommandsCollectorMagicService), ɵɵinject(Router), ɵɵinject(RouterCommandsMagicService)); };
2016
+ SubformMagicService.ɵprov = ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
2017
+ (function () { ɵsetClassMetadata(SubformMagicService, [{
2570
2018
  type: Injectable
2571
2019
  }], function () { return [{ type: TaskMagicService }, { type: ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: Router }, { type: RouterCommandsMagicService }]; }, null); })();
2572
2020
 
2573
- /**
2574
- * Implements various table-related functionalities
2575
- */
2576
2021
  class TableMagicService {
2577
- /**
2578
- *
2579
- * @param componentList Component-mapping service
2580
- * @param task Magic task service
2581
- */
2582
2022
  constructor(componentList, task) {
2583
2023
  this.componentList = componentList;
2584
2024
  this.task = task;
2585
2025
  this.shouldOpenFieldTextEditor = true;
2586
2026
  }
2587
- /**
2588
- * Refreshes the DataSource
2589
- */
2590
2027
  refreshDataSource() {
2591
2028
  }
2592
- /**
2593
- * Returns the table page size
2594
- */
2595
2029
  getPageSize() {
2596
2030
  return 10;
2597
2031
  }
2598
- /**
2599
- * Returns max no of rows in the table.
2600
- */
2601
2032
  getMaxRowsInTable() {
2602
2033
  return this.task.Records.list.length;
2603
2034
  }
2604
- /**
2605
- * Selects the specified row
2606
- * @param rowId The row to select
2607
- */
2608
2035
  selectRow(rowId) {
2609
2036
  this.selectedItem = rowId;
2610
2037
  }
2611
2038
  getSelectedRow() {
2612
2039
  return this.selectedItem;
2613
2040
  }
2614
- /**
2615
- * Returns the selected row
2616
- */
2617
2041
  selectedRow() {
2618
2042
  return null;
2619
2043
  }
2620
- /**
2621
- * Selects the specified page
2622
- * @param pageId The page to select
2623
- */
2624
2044
  selectPage(pageId) {
2625
2045
  }
2626
- /**
2627
- * Returns whether a dialog should be opened for the HTML element
2628
- * @param element The HTML element for which a dialog may be needed
2629
- * @returns
2630
- */
2631
2046
  OpenDialogForControl(element) {
2632
2047
  if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
2633
2048
  element.tagName === "INPUT" ||
@@ -2635,34 +2050,17 @@ class TableMagicService {
2635
2050
  return false;
2636
2051
  return true;
2637
2052
  }
2638
- /**
2639
- * Returns the dialog used to edit values
2640
- */
2641
2053
  getDialog() {
2642
2054
  return null;
2643
2055
  }
2644
- /**
2645
- * Handles the table "scrolled" event
2646
- */
2647
2056
  onScrollDown() {
2648
2057
  this.task.onScrollDown();
2649
2058
  }
2650
- /**
2651
- * To be overwitten in specific implelemtations
2652
- */
2653
2059
  sortData(e) { }
2654
- /**
2655
- * To be overwitten in specific implelemtations
2656
- */
2657
2060
  mgOnPaginateChange(e) { }
2658
2061
  mgOptionChanged(e) { }
2659
- /**
2660
- * Change the number of lines in a table
2661
- * @param size New number of lines in table
2662
- */
2663
2062
  updateTableSize(size) {
2664
- if (size === 0) // never remove row 0 for now
2665
- {
2063
+ if (size === 0) {
2666
2064
  size = 1;
2667
2065
  this.task.Records.clearFirstTableRecord(this.task.template);
2668
2066
  }
@@ -2670,17 +2068,11 @@ class TableMagicService {
2670
2068
  this.task.Records.updateSize(size);
2671
2069
  this.task.setIncludesFirst(false);
2672
2070
  }
2673
- /**
2674
- * @ignore
2675
- */
2676
2071
  setTableTopIndex(value) {
2677
2072
  if (!this.task.Records.includesFirst)
2678
2073
  value++;
2679
2074
  this.task.Records.setGuiTopIndex(value);
2680
2075
  }
2681
- /**
2682
- * @ignore
2683
- */
2684
2076
  getTableTopIndex() {
2685
2077
  let topIndex = this.task.Records.getGuiTopIndex();
2686
2078
  if (!this.task.Records.includesFirst)
@@ -2688,55 +2080,32 @@ class TableMagicService {
2688
2080
  return topIndex;
2689
2081
  }
2690
2082
  }
2691
- /** @nocollapse */ TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(ɵɵinject(ComponentListMagicService), ɵɵinject(TaskMagicService)); };
2692
- /** @nocollapse */ TableMagicService.ɵprov = ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
2693
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TableMagicService, [{
2083
+ TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(ɵɵinject(ComponentListMagicService), ɵɵinject(TaskMagicService)); };
2084
+ TableMagicService.ɵprov = ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
2085
+ (function () { ɵsetClassMetadata(TableMagicService, [{
2694
2086
  type: Injectable
2695
2087
  }], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null); })();
2696
2088
 
2697
- /**
2698
- * Enables changing the browser title using Magic expression (SetTitle)
2699
- */
2700
2089
  class TitleMagicService {
2701
- /**
2702
- *
2703
- * @param titleService Angular's title-changing class
2704
- */
2705
2090
  constructor(titleService) {
2706
2091
  this.titleService = titleService;
2707
2092
  }
2708
- /**
2709
- * Set the new title of the window
2710
- * @param newTitle New title of the window
2711
- */
2712
2093
  setTitle(newTitle) {
2713
2094
  this.titleService.setTitle(newTitle);
2714
2095
  }
2715
2096
  }
2716
- /** @nocollapse */ TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(ɵɵinject(Title)); };
2717
- /** @nocollapse */ TitleMagicService.ɵprov = ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
2718
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TitleMagicService, [{
2097
+ TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(ɵɵinject(Title)); };
2098
+ TitleMagicService.ɵprov = ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
2099
+ (function () { ɵsetClassMetadata(TitleMagicService, [{
2719
2100
  type: Injectable
2720
2101
  }], function () { return [{ type: Title }]; }, null); })();
2721
2102
 
2722
- /**
2723
- * Provides the UI with values calculated by the Magic WebClient
2724
- */
2725
2103
  class AccessorMagicService {
2726
- /**
2727
- * @ignore
2728
- */
2729
2104
  constructor(task) {
2730
2105
  this.task = task;
2731
2106
  this.Logger = null;
2732
2107
  this.Logger = Logger.Instance;
2733
2108
  }
2734
- /**
2735
- * Checks if the control is read-only
2736
- * @param controlId Id of control
2737
- * @returns Is the control not read-only
2738
- */
2739
- // CheckReadOnly
2740
2109
  checkIsReadOnly(controlId) {
2741
2110
  let properties;
2742
2111
  properties = this.task.Records.list[0].getControlMetadata(controlId);
@@ -2745,99 +2114,45 @@ class AccessorMagicService {
2745
2114
  else
2746
2115
  return true;
2747
2116
  }
2748
- /**
2749
- * Returns the text of the control
2750
- * @param controlId Id of control
2751
- * @param rowId Id of row, if applicable
2752
- * @returns The text of the control
2753
- */
2754
- // mgGetText
2755
2117
  getText(controlId, rowId) {
2756
2118
  return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
2757
2119
  }
2758
- /**
2759
- * Gets the text of the tab page
2760
- * @param controlId Id of control
2761
- * @param layer Id of tabpage
2762
- * @returns Text of tabpage
2763
- */
2764
- // mgGetTabpageText
2765
2120
  getTabpageText(controlId, layer) {
2766
2121
  const items = this.task.getProperty(controlId, HtmlProperties.ItemsList);
2767
2122
  if (typeof items !== "undefined")
2768
2123
  return items[layer].displayValue;
2769
2124
  return "";
2770
2125
  }
2771
- /**
2772
- * Gets the image defined for the control
2773
- * @param controlId Id of control
2774
- * @param rowId Id of row, if applicable
2775
- * @returns Image set on control
2776
- */
2777
- // mgGetImage
2778
2126
  getImage(controlId, rowId) {
2779
2127
  let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
2780
2128
  return result;
2781
2129
  }
2782
- /**
2783
- * Returns whether an image is set for this control
2784
- * @param controlId Id of control
2785
- * @param rowId Id of row, if applicable
2786
- * @returns returns true if control has an image set on it
2787
- */
2788
- // mgIsImageExists
2789
2130
  isImageExists(controlId, rowId) {
2790
2131
  let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
2791
2132
  return !isNullOrUndefined(result);
2792
2133
  }
2793
- /**
2794
- * Gets the CSS classes set on the control
2795
- * @param controlId Id of control
2796
- * @param rowId Id of row, if applicable
2797
- * @returns The classes for this control
2798
- */
2799
- // mgGetClasses
2800
2134
  getClasses(controlId, rowId) {
2801
2135
  return this.task.getClasses(controlId, rowId);
2802
2136
  }
2803
- /**
2804
- * Gets the CSS styles set on the control
2805
- * @param controlId Id of control
2806
- * @param styleName NAme of style requested
2807
- * @param rowId Id of row, if applicable
2808
- * @returns The style set on the control
2809
- */
2810
- // mgGetStyle
2811
2137
  getStyle(controlId, styleName, rowId) {
2812
2138
  let style = this.task.getStyle(controlId, styleName, rowId);
2813
2139
  return style;
2814
2140
  }
2815
- /**
2816
- * Returns whether a control is visible or not
2817
- * @param controlId Id of control
2818
- * @param rowId Id of row, if applicable
2819
- * @returns Is the control visible or hidden
2820
- */
2821
- // mgGetVisible
2822
2141
  getVisible(controlId, rowId) {
2823
2142
  let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
2824
2143
  return vis ? 'visible' : 'hidden';
2825
2144
  }
2826
- /**
2827
- * Returns object representing numeric picture
2828
- * @param picture string which is defined in magic
2829
- * @returns object representing numeric picture
2830
- */
2831
- // mgGetNumericPicture
2832
2145
  getNumericPicture(picture) {
2833
2146
  if (isNullOrUndefined(picture))
2834
2147
  return null;
2835
2148
  let pic = new PIC(picture, StorageAttribute.NUMERIC, 0);
2836
2149
  var obj = {};
2837
- if (pic.getPosPref_().length > 0)
2838
- obj['prefix'] = pic.getPosPref_();
2839
- else
2840
- obj['prefix'] = "";
2150
+ obj['prefix'] = "";
2151
+ if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
2152
+ let pref = '-' + pic.getPosPref_();
2153
+ if (pref == pic.getNegPref_())
2154
+ obj['prefix'] = pic.getPosPref_();
2155
+ }
2841
2156
  if (pic.getPosSuff_().length > 0)
2842
2157
  obj['suffix'] = pic.getPosSuff_();
2843
2158
  else
@@ -2859,118 +2174,51 @@ class AccessorMagicService {
2859
2174
  obj['wholes'] = pic.getWholes();
2860
2175
  return obj;
2861
2176
  }
2862
- /**
2863
- * Returns whether a control should have the "required" attribute set on it
2864
- * @param controlId Id of control
2865
- * @param rowId Id of row, if applicable
2866
- * @returns
2867
- */
2868
- // mgGetMustInput
2869
2177
  getMustInput(controlId, rowId) {
2870
2178
  let vis = this.getProperty(controlId, HtmlProperties.MustInput, rowId);
2871
2179
  return vis ? 'true' : 'false';
2872
2180
  }
2873
- /**
2874
- * Returns whether a control is disabled
2875
- * @param controlId Id of control
2876
- * @param rowId Id of row, if applicable
2877
- * @returns
2878
- */
2879
- // mgIsDisabled
2880
2181
  isDisabled(controlId, rowId) {
2881
2182
  let result = this.getProperty(controlId, HtmlProperties.Enabled, rowId);
2882
2183
  return result === true ? null : true;
2883
2184
  }
2884
- /**
2885
- * @ignore
2886
- */
2887
- // getProperty (not changed)
2888
2185
  getProperty(controlId, prop, rowId) {
2889
2186
  return this.task.getProperty(controlId, prop, rowId);
2890
2187
  }
2891
- /**
2892
- * Returns the title (tooltip) text of the control
2893
- * @param controlId Id of control
2894
- * @param rowId Id of row, if applicable
2895
- * @returns
2896
- */
2897
- // mgGetTitle
2898
2188
  getTitle(controlId, rowId) {
2899
2189
  return this.task.getProperty(controlId, HtmlProperties.Tooltip, rowId);
2900
2190
  }
2901
- /**
2902
- * Gets the selection control's selected value
2903
- * @param controlId Id of control
2904
- * @param rowId Id of row, if applicable
2905
- * @returns
2906
- */
2907
- // getSelectedValue
2191
+ getZoomButtonTitle(controlId, rowId) {
2192
+ return this.task.getProperty(controlId, HtmlProperties.ZoomButtonTooltip, rowId);
2193
+ }
2908
2194
  getSelectedValue(controlId, rowId) {
2909
2195
  return this.task.getProperty(controlId, HtmlProperties.SelectedValue, rowId);
2910
2196
  }
2911
- /**
2912
- * Gets the place-holder text of the control
2913
- * @param controlId Id of control
2914
- * @param rowId Id of row, if applicable
2915
- * @returns
2916
- */
2917
- // mgGetPlaceholder
2918
2197
  getPlaceholder(controlId, rowId) {
2919
2198
  return this.task.getProperty(controlId, HtmlProperties.PlaceHolder, rowId);
2920
2199
  }
2921
- /**
2922
- * Returns a type for input controls - should the control be a simple text or a password control
2923
- * @param controlId Id of control
2924
- * @param rowId Id of row, if applicable
2925
- * @returns
2926
- */
2927
- // mgGetType
2928
2200
  getType(controlId, rowId) {
2929
2201
  let result = this.task.getProperty(controlId, HtmlProperties.Password, rowId);
2930
2202
  return result ? "password" : "text";
2931
2203
  }
2932
- /**
2933
- * Returns the tab-index of the control
2934
- * @param controlId Id of control
2935
- * @param rowId Id of row, if applicable
2936
- * @returns
2937
- */
2938
- // mgGetTabIndex
2939
2204
  getTabIndex(controlId, rowId) {
2940
2205
  return this.task.getProperty(controlId, HtmlProperties.TabIndex, rowId);
2941
2206
  }
2942
- /**
2943
- * Returns the value of the control
2944
- * @param controlId Id of control
2945
- * @param rowId Id of row, if applicable
2946
- * @returns
2947
- */
2948
- /// mgGetValue -->
2949
2207
  getValue(controlId, rowId) {
2950
2208
  let val = this.task.getValue(controlId, rowId);
2951
2209
  return val;
2952
2210
  }
2953
- /**
2954
- * Returns the Picture of the control
2955
- * @param controlId Id of control
2956
- * @param rowId Id of row, if applicable
2957
- * @returns
2958
- */
2959
- /// getPicture -->
2211
+ getFormattedValue(controlId, rowId) {
2212
+ let val = this.task.getValue(controlId, rowId);
2213
+ val = this.task.getFormattedValue(controlId, val);
2214
+ return val;
2215
+ }
2960
2216
  getPicture(controlId, rowId) {
2961
2217
  if (isNullOrUndefined(controlId))
2962
2218
  return null;
2963
2219
  let pic = this.task.GetControlPictureMask(controlId);
2964
2220
  return (pic != null) ? pic.getFormat().toString() : null;
2965
2221
  }
2966
- /**
2967
- * Returns the custom (user) properties of the control
2968
- * @param controlId Id of control
2969
- * @param propertyName Name of requested property
2970
- * @param rowId Id of row, if applicable
2971
- * @returns
2972
- */
2973
- // mgGetCustomProperty
2974
2222
  getCustomProperty(controlId, propertyNameOrRowID, rowId) {
2975
2223
  if (controlId.indexOf('~') == -1)
2976
2224
  return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
@@ -2995,22 +2243,9 @@ class AccessorMagicService {
2995
2243
  }
2996
2244
  return userProperties;
2997
2245
  }
2998
- /**
2999
- * Gets the values of the items of a selection control
3000
- * @param id Id of control
3001
- * @param rowId Id of row, if applicable
3002
- * @returns
3003
- */
3004
- // mgGetItemListValues
3005
2246
  getItemListValues(id, rowId) {
3006
2247
  return this.getProperty(id, HtmlProperties.ItemsList, rowId);
3007
2248
  }
3008
- /**
3009
- * Gets the display value of the item from items of a selection control
3010
- * @param id Id of control
3011
- * @param rowId Id of row, if applicable
3012
- * @returns
3013
- */
3014
2249
  getDisplayValue(id, rowId) {
3015
2250
  let displayValue = "";
3016
2251
  let o = this.getProperty(id, HtmlProperties.ItemsList, rowId);
@@ -3019,12 +2254,6 @@ class AccessorMagicService {
3019
2254
  displayValue = o[value].displayValue;
3020
2255
  return displayValue;
3021
2256
  }
3022
- /**
3023
- * Returns whether a tab page is selected or not
3024
- * @param index of current option in iterarotr
3025
- * @param control Id of list control
3026
- * @returns
3027
- */ // isOptionSelected
3028
2257
  isOptionSelected(index, controlId) {
3029
2258
  let val = this.task.getValue(controlId, "0");
3030
2259
  for (let item of val) {
@@ -3033,40 +2262,18 @@ class AccessorMagicService {
3033
2262
  }
3034
2263
  return false;
3035
2264
  }
3036
- /**
3037
- * Returns whether a tab page is selected or not - used for the tab buttons
3038
- * @param controlId Id of control
3039
- * @param layer Id of the tab page
3040
- * @returns
3041
- */ // mgIsTabPageSelected
3042
2265
  isTabPageSelected(controlId, layer) {
3043
2266
  let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
3044
- return val == (layer - 1); // comparing string to number!
3045
- }
3046
- /**
3047
- * Returns whether a tab page layer is selected or not - used for the div which represents the tab page
3048
- * @param controlId Id of control
3049
- * @param layer Id of the tab page
3050
- * @returns
3051
- */ // mgIsTabLayerSelected
2267
+ return val == (layer - 1);
2268
+ }
3052
2269
  isTabPageLayerSelected(controlId, layer) {
3053
2270
  let val = this.task.getProperty(controlId, HtmlProperties.SelectedLayer);
3054
- return val == (layer - 1); // comparing string to number!
2271
+ return val == (layer - 1);
3055
2272
  }
3056
- /**
3057
- * Returns the index of the selected tab page
3058
- * @param controlId Id of control
3059
- * @returns
3060
- */
3061
2273
  getTabSelectedIndex(controlId) {
3062
2274
  let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
3063
- return val; // comparing string to number!
2275
+ return val;
3064
2276
  }
3065
- // private methodes
3066
- /**
3067
- * @ignore
3068
- */
3069
- // mgIfRowCreated
3070
2277
  ifRowCreated(row) {
3071
2278
  if (row == null)
3072
2279
  return false;
@@ -3074,48 +2281,25 @@ class AccessorMagicService {
3074
2281
  let result = this.getFormGroupByRow(rowId);
3075
2282
  return !isNullOrUndefined(result);
3076
2283
  }
3077
- /**
3078
- * @ignore
3079
- */
3080
- // mgGetFormGroupByRow
3081
2284
  getFormGroupByRow(id) {
3082
2285
  return this.task.formGroups[id];
3083
2286
  }
3084
- /**
3085
- * @ignore
3086
- */
3087
- // isRowSelected (not changed)
3088
2287
  isRowSelected(controlId, rowId) {
3089
2288
  const selectedRow = this.task.getProperty(controlId, HtmlProperties.SelectedRow, "0");
3090
2289
  return selectedRow == rowId;
3091
2290
  }
3092
- /**
3093
- * Returns whether a row is in edit state
3094
- * @param row
3095
- */
3096
2291
  isRowInRowEditing(row) {
3097
2292
  let guiRowId = '0';
3098
2293
  guiRowId = typeof row == "number" ? row.toString() : row.rowId;
3099
2294
  return this.task.isRowInRowEditing(guiRowId);
3100
2295
  }
3101
- /**
3102
- * Returns whether a row is in edit state, use this method while control outside table control
3103
- * @param row
3104
- */
3105
2296
  isCurrentInRowEditing() {
3106
2297
  let row = this.task.tableService.getSelectedRow();
3107
2298
  return this.task.isRowInRowEditing(row);
3108
2299
  }
3109
- /**
3110
- * @ignore
3111
- */
3112
- // GetGuiTopIndex
3113
2300
  guiTopIndex() {
3114
2301
  return this.task.tableService.getTableTopIndex();
3115
2302
  }
3116
- /**
3117
- * @ignore
3118
- */
3119
2303
  getErrMsg(id, rowId) {
3120
2304
  let c = this.task.getFormControl(rowId, id);
3121
2305
  if (c.hasError('required'))
@@ -3137,12 +2321,6 @@ class AccessorMagicService {
3137
2321
  }
3138
2322
  return 'unknown error';
3139
2323
  }
3140
- /**
3141
- * Sets a user-supplied value to the specified control
3142
- * @param controlName
3143
- * @param value
3144
- * @param refreshDisplay
3145
- */
3146
2324
  setValueToControl(controlName, value, refreshDisplay) {
3147
2325
  if (typeof refreshDisplay === "undefined")
3148
2326
  refreshDisplay = true;
@@ -3151,44 +2329,28 @@ class AccessorMagicService {
3151
2329
  guiEvent.param = refreshDisplay;
3152
2330
  this.task.insertEvent(guiEvent);
3153
2331
  }
3154
- /**
3155
- * @ignore
3156
- */
3157
2332
  isDataviewEmpty() {
3158
2333
  return this.task.Records.isEmptyDataView;
3159
2334
  }
3160
- /**
3161
- * simulates a click event on the specified control, for the Magic engine
3162
- * @param controlName
3163
- * @param rowId
3164
- */
3165
2335
  simulateClick(controlName, rowId) {
3166
2336
  if (typeof rowId === "undefined")
3167
2337
  rowId = 0;
3168
2338
  this.task.insertEvent(getGuiEventObj('click', controlName, rowId));
3169
2339
  }
3170
- /**
3171
- * Return Boolean TRUE if user logged in Else it will return FALSE
3172
- */
3173
2340
  isLoggedIn() {
3174
2341
  return this.task.getIsLoggenIn();
3175
2342
  }
3176
- /**
3177
- * Returns JS object containing the records with all table fields.
3178
- */
3179
2343
  GetFormRecords() {
3180
2344
  let rowId = 0;
3181
2345
  let recArray;
3182
2346
  if (!isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
3183
2347
  let recList = this.task.Records.list;
3184
2348
  let tableControls = new Array();
3185
- //Generate list of table fields names
3186
2349
  for (const key in this.task.template) {
3187
2350
  if (this.task.template[key] == '1')
3188
2351
  tableControls.push(key);
3189
2352
  }
3190
2353
  recArray = new Array();
3191
- //Update the records as list of objects with values for table fields.
3192
2354
  if (tableControls.length > 0) {
3193
2355
  recList.forEach((ctrlMetaData) => {
3194
2356
  if (this.task.Records.isRowCreated(rowId)) {
@@ -3204,20 +2366,23 @@ class AccessorMagicService {
3204
2366
  }
3205
2367
  return recArray;
3206
2368
  }
2369
+ SetCookie(name, value, expires, path, domain, secure, sameSite) {
2370
+ CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
2371
+ }
2372
+ GetCookie(name) {
2373
+ return CookieService.getCookie(name);
2374
+ }
2375
+ DeleteCookie(name) {
2376
+ return CookieService.deleteCookie(name);
2377
+ }
3207
2378
  }
3208
- /** @nocollapse */ AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(ɵɵinject(TaskMagicService)); };
3209
- /** @nocollapse */ AccessorMagicService.ɵprov = ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
3210
- /*@__PURE__*/ (function () { ɵsetClassMetadata(AccessorMagicService, [{
2379
+ AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(ɵɵinject(TaskMagicService)); };
2380
+ AccessorMagicService.ɵprov = ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
2381
+ (function () { ɵsetClassMetadata(AccessorMagicService, [{
3211
2382
  type: Injectable
3212
2383
  }], function () { return [{ type: TaskMagicService }]; }, null); })();
3213
2384
 
3214
- /**
3215
- * Central place for adding the Magic services
3216
- */
3217
2385
  class MagicServices {
3218
- /**
3219
- * @ignore
3220
- */
3221
2386
  constructor(task, subformService, tableService, titleService, mgAccessorService) {
3222
2387
  this.task = task;
3223
2388
  this.subformService = subformService;
@@ -3230,74 +2395,36 @@ class MagicServices {
3230
2395
  task.mgAccessorService = mgAccessorService;
3231
2396
  }
3232
2397
  }
3233
- /** @nocollapse */ MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(ɵɵinject(TaskMagicService), ɵɵinject(SubformMagicService), ɵɵinject(TableMagicService), ɵɵinject(TitleMagicService), ɵɵinject(AccessorMagicService)); };
3234
- /** @nocollapse */ MagicServices.ɵprov = ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
3235
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicServices, [{
2398
+ MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(ɵɵinject(TaskMagicService), ɵɵinject(SubformMagicService), ɵɵinject(TableMagicService), ɵɵinject(TitleMagicService), ɵɵinject(AccessorMagicService)); };
2399
+ MagicServices.ɵprov = ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
2400
+ (function () { ɵsetClassMetadata(MagicServices, [{
3236
2401
  type: Injectable
3237
2402
  }], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null); })();
3238
2403
 
3239
- /**
3240
- * Base component representing a Magic task
3241
- */
3242
2404
  class TaskBaseMagicComponent {
3243
- /**
3244
- *
3245
- * @param ref changes-detector object
3246
- * @param magicServices Access point for all Magic services
3247
- */
3248
2405
  constructor(ref, magicServices) {
3249
2406
  this.ref = ref;
3250
2407
  this.magicServices = magicServices;
3251
- /**
3252
- * @ignore
3253
- */
3254
2408
  this.magicProperties = MagicProperties;
3255
2409
  }
3256
- /**
3257
- * Returns the Magic task service
3258
- * @returns
3259
- */
3260
2410
  get task() {
3261
2411
  return this.magicServices.task;
3262
2412
  }
3263
- /**
3264
- * Returns the Magic subform service
3265
- * @returns
3266
- */
3267
2413
  get mgSub() {
3268
2414
  return this.magicServices.subformService;
3269
2415
  }
3270
- /**
3271
- * Returns the Magic table service
3272
- * @returns
3273
- */
3274
2416
  get tableService() {
3275
2417
  return this.magicServices.tableService;
3276
2418
  }
3277
- /**
3278
- * Returns the Magic accessor service
3279
- * @returns
3280
- */
3281
2419
  get mg() {
3282
2420
  return this.magicServices.mgAccessorService;
3283
2421
  }
3284
- /**
3285
- * Returns the task Id
3286
- * @returns
3287
- */
3288
2422
  get taskId() {
3289
2423
  return this.task.taskId;
3290
2424
  }
3291
- /**
3292
- * Returns the FormGroup for screen-mode forms
3293
- * @returns
3294
- */
3295
2425
  get screenFormGroup() {
3296
2426
  return this.task.ScreenModeControls;
3297
2427
  }
3298
- /**
3299
- * Interface implementation
3300
- */
3301
2428
  ngOnInit() {
3302
2429
  let subscription = this.task.detectChanges.pipe().subscribe(c => {
3303
2430
  this.ref.detectChanges();
@@ -3305,48 +2432,19 @@ class TaskBaseMagicComponent {
3305
2432
  this.task.initTask(this.taskIdParam, this.taskDescription);
3306
2433
  this.createFormControlsAccessor(this.screenFormGroup);
3307
2434
  this.setInputDateFormat();
3308
- // subcribe to custom property changes
3309
2435
  this.task.customPropertiesSubject.pipe().subscribe(property => {
3310
2436
  this.PropertyChanged(property.propertyName, property.rowId, property.value);
3311
2437
  });
3312
- // subcribe to records count changes
3313
2438
  this.task.recordsCountChangeSubject.pipe().subscribe(value => {
3314
2439
  this.RecordsCountChanged(value);
3315
2440
  });
3316
2441
  }
3317
- /**
3318
- * @ignore
3319
- */
3320
2442
  createFormControlsAccessor(formGroup) { }
3321
- /**
3322
- * @ignore
3323
- */
3324
2443
  setInputDateFormat() { }
3325
- /**
3326
- * This method is called when the value of any custom property is updated in Magic
3327
- * propertyName : name of property which is updated. The format is <controlname>~<propertyname>
3328
- * rowId : row number of the updated property for controls in table control (0 for controls outside table)
3329
- * value : updated value of the property
3330
- * @returns : void
3331
- * To use the method override it in your component and check the property name and write you code ..for eg
3332
- * if(propertyName == 'controlname~propertyName') {// your code}
3333
- * else { // your code}
3334
- */
3335
2444
  PropertyChanged(propertyName, rowId, value) {
3336
- // intentionally left blank because the implementation should be in the derived class
3337
- }
3338
- /**
3339
- * Records count change subject is subscribed to change in its value. This method will be called
3340
- * as the value of records count is received at from server.
3341
- * @returns : void
3342
- * To use the method override it in your component.
3343
- */
2445
+ }
3344
2446
  RecordsCountChanged(recordsCount) {
3345
- // intentionally left blank because the implementation should be in the derived class
3346
2447
  }
3347
- /**
3348
- * Interface implementation
3349
- */
3350
2448
  ngAfterViewInit() {
3351
2449
  this.mgSub.init();
3352
2450
  }
@@ -3356,16 +2454,13 @@ class TaskBaseMagicComponent {
3356
2454
  this.task.oldPageSize = this.tableService.getPageSize();
3357
2455
  }
3358
2456
  }
3359
- /**
3360
- * Interface implementation
3361
- */
3362
2457
  ngOnDestroy() {
3363
2458
  this.task.dispose();
3364
2459
  }
3365
2460
  }
3366
- /** @nocollapse */ TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(MagicServices)); };
3367
- /** @nocollapse */ TaskBaseMagicComponent.ɵcmp = ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
3368
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TaskBaseMagicComponent, [{
2461
+ TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(MagicServices)); };
2462
+ TaskBaseMagicComponent.ɵcmp = ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
2463
+ (function () { ɵsetClassMetadata(TaskBaseMagicComponent, [{
3369
2464
  type: Component,
3370
2465
  args: [{
3371
2466
  selector: 'task-magic',
@@ -3378,22 +2473,13 @@ class TaskBaseMagicComponent {
3378
2473
  type: Input
3379
2474
  }] }); })();
3380
2475
 
3381
- /**
3382
- * @ignore
3383
- */
3384
2476
  class RowMagicDirective {
3385
2477
  constructor(_task, element) {
3386
2478
  this._task = _task;
3387
2479
  this.element = element;
3388
- /**
3389
- * @ignore
3390
- */
3391
2480
  this.rowChangedSubscriber = null;
3392
2481
  this.htmlElement = this.element.nativeElement;
3393
2482
  }
3394
- /**
3395
- * Initializes this object
3396
- */
3397
2483
  ngOnInit() {
3398
2484
  this.rowChangedSubscriber = this._task
3399
2485
  .OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
@@ -3408,16 +2494,7 @@ class RowMagicDirective {
3408
2494
  return (rect.top >= parentRect.top &&
3409
2495
  rect.bottom <= parentRect.bottom);
3410
2496
  }
3411
- /**
3412
- * Cleanup
3413
- */
3414
2497
  ngOnDestroy() {
3415
- // Don't know why, but when the table is loaded for the first time, we
3416
- // get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
3417
- // for number of rows in the page but here this.rowId is undefined.
3418
- // Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
3419
- // is null and hence crashes.
3420
- // So, the condition to check nulity is added.
3421
2498
  if (this.rowChangedSubscriber !== null) {
3422
2499
  this.rowChangedSubscriber.unsubscribe();
3423
2500
  }
@@ -3429,11 +2506,11 @@ class RowMagicDirective {
3429
2506
  }
3430
2507
  }
3431
2508
  }
3432
- /** @nocollapse */ RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef)); };
3433
- /** @nocollapse */ RowMagicDirective.ɵdir = ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
2509
+ RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef)); };
2510
+ RowMagicDirective.ɵdir = ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3434
2511
  ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
3435
2512
  } }, inputs: { rowId: ["magicRow", "rowId"] } });
3436
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RowMagicDirective, [{
2513
+ (function () { ɵsetClassMetadata(RowMagicDirective, [{
3437
2514
  type: Directive,
3438
2515
  args: [{
3439
2516
  selector: '[magicRow]'
@@ -3446,35 +2523,16 @@ class RowMagicDirective {
3446
2523
  args: ['click', ['$event']]
3447
2524
  }] }); })();
3448
2525
 
3449
- /**
3450
- * Connects HTML elements to the Magic Web Client engine
3451
- */
3452
2526
  class MagicDirective {
3453
- /**
3454
- *
3455
- * @param _task The task service
3456
- * @param element The element for which the directive is applied
3457
- * @param renderer Renderer for the element
3458
- * @param vcRef
3459
- * @param magicRow
3460
- */
3461
2527
  constructor(_task, element, renderer, vcRef, magicRow) {
3462
2528
  this._task = _task;
3463
2529
  this.element = element;
3464
2530
  this.renderer = renderer;
3465
2531
  this.vcRef = vcRef;
3466
2532
  this.magicRow = magicRow;
3467
- /**
3468
- * Collection of event handlers for this element
3469
- */
3470
2533
  this.eventHandlers = {};
3471
2534
  this.eventsOnlyVal = false;
3472
2535
  this.htmlElement = this.element.nativeElement;
3473
- //let c = (<any>this.vcRef)._view;
3474
- //while (!(c instanceof TaskBaseMagicComponent)) {
3475
- // c = c.component;
3476
- //}
3477
- //this.component = c;
3478
2536
  if (!(typeof magicRow === 'undefined' || magicRow === null))
3479
2537
  this.rowId = magicRow.rowId;
3480
2538
  }
@@ -3483,35 +2541,26 @@ class MagicDirective {
3483
2541
  this.selector = 'magic';
3484
2542
  }
3485
2543
  ;
3486
- /**
3487
- * This flag is used when we only want to register to events, but do not want to execute commands sent from server
3488
- */
3489
2544
  set eventsOnly(val) {
3490
2545
  console.log('eventsOnly');
3491
2546
  this.eventsOnlyVal = true;
3492
2547
  }
3493
2548
  ;
3494
- /**
3495
- * Get the task service
3496
- * @returns
3497
- */
3498
2549
  get task() {
3499
2550
  return this._task;
3500
2551
  }
3501
- /**
3502
- * Register to the events this element may need to handle
3503
- */
3504
2552
  regEvents() {
3505
- // Handle events for which event handler may be removed and restored
3506
2553
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
3507
2554
  Object.keys(this.eventHandlers).forEach((key) => {
3508
2555
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
3509
2556
  });
3510
- // Handle events with anonymous event handlers
3511
- let events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
2557
+ let events = ['click', 'mousedown', 'dblclick'];
3512
2558
  events.forEach(event => {
3513
2559
  this.renderer.listen(this.htmlElement, event, (e) => {
3514
- this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId));
2560
+ let fromButton = false;
2561
+ if (this.htmlElement instanceof HTMLButtonElement)
2562
+ fromButton = true;
2563
+ this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
3515
2564
  e.cancelBubble = true;
3516
2565
  });
3517
2566
  });
@@ -3523,13 +2572,10 @@ class MagicDirective {
3523
2572
  this.task.insertEvent(guiEvent);
3524
2573
  }
3525
2574
  });
3526
- // handle the input event
3527
2575
  fromEvent(this.htmlElement, 'input').pipe(map((event) => {
3528
2576
  return event.target.value;
3529
- }), debounceTime(200) // time after which value will be sent to magic
3530
- ).subscribe((x) => {
2577
+ }), debounceTime(200)).subscribe((x) => {
3531
2578
  if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
3532
- // Don't support character binding for date/time values
3533
2579
  let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
3534
2580
  if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
3535
2581
  this.task.mgAccessorService.setValueToControl(this.id, x, true);
@@ -3555,25 +2601,16 @@ class MagicDirective {
3555
2601
  (e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
3556
2602
  if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
3557
2603
  guiEvent.keyCode = e.keyCode;
3558
- // Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
3559
2604
  if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && !MagicDirective.opened)
3560
2605
  e.cancelBubble = true;
3561
2606
  this.task.insertEvent(guiEvent);
3562
2607
  }
3563
2608
  });
3564
2609
  }
3565
- /**
3566
- * Handle focus event
3567
- */
3568
2610
  OnFocus() {
3569
2611
  this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
3570
2612
  event.cancelBubble = true;
3571
2613
  }
3572
- /**
3573
- * Is the command's element the same as this directive's element
3574
- * @param command
3575
- * @returns true/false
3576
- */
3577
2614
  IsSameElement(command) {
3578
2615
  let line = command.line;
3579
2616
  if (this.task.isTableControl(command.CtrlName))
@@ -3582,17 +2619,9 @@ class MagicDirective {
3582
2619
  (line === +this.rowId ||
3583
2620
  (line === 0 && isNullOrUndefined(this.rowId))));
3584
2621
  }
3585
- /**
3586
- * Is the command's element the same as this directive's component
3587
- * @param command
3588
- * @returns true/false
3589
- */
3590
2622
  IsSameComponent(command) {
3591
2623
  return (command.controlName === this.id);
3592
2624
  }
3593
- /**
3594
- * @ignore
3595
- */
3596
2625
  regUpdatesUI() {
3597
2626
  this.subscribeRefreshDom = this.task
3598
2627
  .refreshDom.pipe(filter(c => this.IsSameElement(c)))
@@ -3614,17 +2643,10 @@ class MagicDirective {
3614
2643
  this.handleInteractiveCommands(command);
3615
2644
  });
3616
2645
  }
3617
- /**
3618
- * Initializes this object
3619
- */
3620
2646
  ngOnInit() {
3621
2647
  this.regEvents();
3622
2648
  this.regUpdatesUI();
3623
2649
  }
3624
- /**
3625
- * Handles the commands received from the Magic WebClient engine
3626
- * @param command
3627
- */
3628
2650
  handleCommand(command) {
3629
2651
  switch (command.CommandType) {
3630
2652
  case CommandType.SET_PROPERTY:
@@ -3632,14 +2654,12 @@ class MagicDirective {
3632
2654
  break;
3633
2655
  case CommandType.SET_FOCUS:
3634
2656
  this.focusUnlistener();
3635
- this.htmlElement.focus();
2657
+ if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
2658
+ this.htmlElement.focus();
3636
2659
  this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
3637
2660
  break;
3638
2661
  }
3639
2662
  }
3640
- /**
3641
- * handle the interactive commands like CallJS
3642
- */
3643
2663
  handleInteractiveCommands(command) {
3644
2664
  switch (command._commandType) {
3645
2665
  case InteractiveCommandType.CALL_JS:
@@ -3649,24 +2669,18 @@ class MagicDirective {
3649
2669
  let resultString = '';
3650
2670
  try {
3651
2671
  if (!isNullOrUndefined(magicComponent[methodName])) {
3652
- // invoke the method on instance of magic componenet
3653
2672
  resultString = magicComponent[methodName].apply(magicComponent, args);
3654
2673
  }
3655
2674
  else
3656
- console.error('Instance method ' + methodName + ' does not exists'); // when method is not found
2675
+ console.error('Instance method ' + methodName + ' does not exists');
3657
2676
  }
3658
2677
  catch (e) {
3659
- // any other exception
3660
2678
  console.error(e.message);
3661
2679
  }
3662
- command.resultString = resultString; // update the return value
2680
+ command.resultString = resultString;
3663
2681
  break;
3664
2682
  }
3665
2683
  }
3666
- /**
3667
- * Handle the Magic set-property command
3668
- * @param command
3669
- */
3670
2684
  handleSetProperty(command) {
3671
2685
  switch (command.Operation) {
3672
2686
  case HtmlProperties.ReadOnly:
@@ -3677,17 +2691,14 @@ class MagicDirective {
3677
2691
  break;
3678
2692
  }
3679
2693
  }
3680
- /**
3681
- * Cleanup
3682
- */
3683
2694
  ngOnDestroy() {
3684
2695
  this.subscribeRefreshDom.unsubscribe();
3685
2696
  }
3686
2697
  }
3687
2698
  MagicDirective.opened = false;
3688
- /** @nocollapse */ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
3689
- /** @nocollapse */ MagicDirective.ɵdir = ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
3690
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicDirective, [{
2699
+ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
2700
+ MagicDirective.ɵdir = ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
2701
+ (function () { ɵsetClassMetadata(MagicDirective, [{
3691
2702
  type: Directive,
3692
2703
  args: [{
3693
2704
  selector: '[magic]'
@@ -3704,9 +2715,6 @@ MagicDirective.opened = false;
3704
2715
  type: Input
3705
2716
  }] }); })();
3706
2717
 
3707
- /**
3708
- * @ignore
3709
- */
3710
2718
  class NoControlMagicDirective extends MagicDirective {
3711
2719
  constructor(_task, element, renderer, vcRef, magicRow) {
3712
2720
  super(_task, element, renderer, vcRef, magicRow);
@@ -3741,12 +2749,10 @@ class NoControlMagicDirective extends MagicDirective {
3741
2749
  }
3742
2750
  }
3743
2751
  }
3744
- // is the div a tab control
3745
2752
  isTabControl() {
3746
2753
  return this.htmlElement instanceof HTMLDivElement &&
3747
2754
  this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
3748
2755
  }
3749
- // is the div a radio buttons wrapper
3750
2756
  isRadio() {
3751
2757
  return this.htmlElement instanceof HTMLDivElement &&
3752
2758
  this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
@@ -3755,7 +2761,6 @@ class NoControlMagicDirective extends MagicDirective {
3755
2761
  super.handleCommand(command);
3756
2762
  switch (command.CommandType) {
3757
2763
  case CommandType.SET_CLASS:
3758
- //remove the class which was replaced by this new one, as registered in the ControlMetadata
3759
2764
  const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
3760
2765
  if (controlMetadata.removedClass != '') {
3761
2766
  this.htmlElement.classList.remove(controlMetadata.removedClass);
@@ -3768,7 +2773,7 @@ class NoControlMagicDirective extends MagicDirective {
3768
2773
  this.htmlElement.innerText = command.value;
3769
2774
  if (this.htmlElement instanceof HTMLSelectElement)
3770
2775
  this.htmlElement.value = command.value;
3771
- if (this.htmlElement instanceof HTMLAnchorElement) //hyper-text button
2776
+ if (this.htmlElement instanceof HTMLAnchorElement)
3772
2777
  this.htmlElement.text = command.value;
3773
2778
  if (this.htmlElement instanceof HTMLInputElement) {
3774
2779
  if (this.htmlElement.type === "checkbox") {
@@ -3792,7 +2797,6 @@ class NoControlMagicDirective extends MagicDirective {
3792
2797
  break;
3793
2798
  }
3794
2799
  }
3795
- // handle set-property commands
3796
2800
  handleSetProperty(command) {
3797
2801
  super.handleSetProperty(command);
3798
2802
  switch (command.Operation) {
@@ -3808,7 +2812,6 @@ class NoControlMagicDirective extends MagicDirective {
3808
2812
  break;
3809
2813
  case HtmlProperties.ItemsList:
3810
2814
  if (this.htmlElement instanceof HTMLSelectElement) {
3811
- // clear the list
3812
2815
  var len = this.htmlElement.length;
3813
2816
  for (var i = len - 1; i >= 0; i--) {
3814
2817
  this.htmlElement.remove(i);
@@ -3850,8 +2853,7 @@ class NoControlMagicDirective extends MagicDirective {
3850
2853
  let child = tabControl.children[i];
3851
2854
  const layer = child.getAttribute('layer') - 1;
3852
2855
  if (child instanceof HTMLButtonElement) {
3853
- // set button style
3854
- if (layer == command.obj1) { // compare int to string
2856
+ if (layer == command.obj1) {
3855
2857
  child.classList.add('tab_button_active');
3856
2858
  }
3857
2859
  else {
@@ -3859,7 +2861,6 @@ class NoControlMagicDirective extends MagicDirective {
3859
2861
  }
3860
2862
  }
3861
2863
  else {
3862
- // not a buton - hide unselected tabpages
3863
2864
  let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
3864
2865
  child.setAttribute('style', style);
3865
2866
  }
@@ -3881,9 +2882,9 @@ class NoControlMagicDirective extends MagicDirective {
3881
2882
  }
3882
2883
  }
3883
2884
  }
3884
- /** @nocollapse */ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
3885
- /** @nocollapse */ NoControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [ɵɵInheritDefinitionFeature] });
3886
- /*@__PURE__*/ (function () { ɵsetClassMetadata(NoControlMagicDirective, [{
2885
+ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
2886
+ NoControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [ɵɵInheritDefinitionFeature] });
2887
+ (function () { ɵsetClassMetadata(NoControlMagicDirective, [{
3887
2888
  type: Directive,
3888
2889
  args: [{
3889
2890
  selector: '[magicnc]'
@@ -3895,20 +2896,7 @@ class NoControlMagicDirective extends MagicDirective {
3895
2896
  args: ['magicnc']
3896
2897
  }] }); })();
3897
2898
 
3898
- /**
3899
- * Mock component, implements routing by connecting the requested URL with the appropriate Magic task
3900
- */
3901
2899
  class RouterContainerMagicComponent {
3902
- /**
3903
- *
3904
- * @param changeDetectorRef
3905
- * @param activatedRoute
3906
- * @param magic
3907
- * @param componentFactoryResolver
3908
- * @param viewContainerRef
3909
- * @param componentList
3910
- * @param pendingCommandsCollector
3911
- */
3912
2900
  constructor(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
3913
2901
  this.activatedRoute = activatedRoute;
3914
2902
  this.magic = magic;
@@ -3921,9 +2909,6 @@ class RouterContainerMagicComponent {
3921
2909
  this.componentRef = null;
3922
2910
  this.parentMgSubformService = null;
3923
2911
  }
3924
- /**
3925
- * Initialization
3926
- */
3927
2912
  ngOnInit() {
3928
2913
  let outletname = this.activatedRoute.outlet;
3929
2914
  let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
@@ -3941,10 +2926,7 @@ class RouterContainerMagicComponent {
3941
2926
  guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
3942
2927
  if (currentActiveRoute.snapshot.outlet !== 'primary')
3943
2928
  guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
3944
- // if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
3945
- // need to take the path form routeConfig.path
3946
2929
  let calcRouterPath = currentActiveRoute.routeConfig.path;
3947
- // add the RouterPath only if exist
3948
2930
  if (calcRouterPath.length > 0) {
3949
2931
  let routerPath = calcRouterPath;
3950
2932
  let tokens = StrUtil.tokenize(routerPath, "/:");
@@ -3957,7 +2939,6 @@ class RouterContainerMagicComponent {
3957
2939
  this.containerTaskService.insertEvent(guiEvent);
3958
2940
  }
3959
2941
  initializeComponent() {
3960
- // re-init subformMagicService since it may change after executing "RouterNavigate" event.
3961
2942
  let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
3962
2943
  if (subformMagicService.currentRouteDefinition !== null) {
3963
2944
  let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
@@ -3970,9 +2951,6 @@ class RouterContainerMagicComponent {
3970
2951
  this.parentMgSubformService = subformMagicService;
3971
2952
  subformMagicService.currentRouteDefinition = null;
3972
2953
  SubformMagicService.currentCallerMgSubformServiceRef = null;
3973
- //When the component is initialized, then also we get the notification for paramMap subscription.
3974
- //But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
3975
- //So, control it via ignoreParamChange flag.
3976
2954
  let ignoreParamChange = true;
3977
2955
  myActiveRoute.paramMap.subscribe(params => {
3978
2956
  if (!ignoreParamChange)
@@ -3983,12 +2961,7 @@ class RouterContainerMagicComponent {
3983
2961
  this.routerCommandsMagicService.ExecuteNextCommand();
3984
2962
  }
3985
2963
  }
3986
- /**
3987
- * Cleanup
3988
- */
3989
2964
  ngOnDestroy() {
3990
- // TODO Routing: Call close() only if the task is not already closed.
3991
- // Task can be closed when a router is overlayed by another task via call operation.
3992
2965
  if (this.componentRef != null) {
3993
2966
  this.componentRef.instance.task.close();
3994
2967
  let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
@@ -3996,9 +2969,9 @@ class RouterContainerMagicComponent {
3996
2969
  }
3997
2970
  }
3998
2971
  }
3999
- /** @nocollapse */ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(ɵɵdirectiveInject(ActivatedRoute), ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(RouterCommandsMagicService)); };
4000
- /** @nocollapse */ RouterContainerMagicComponent.ɵcmp = ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
4001
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RouterContainerMagicComponent, [{
2972
+ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(ɵɵdirectiveInject(ActivatedRoute), ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(RouterCommandsMagicService)); };
2973
+ RouterContainerMagicComponent.ɵcmp = ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
2974
+ (function () { ɵsetClassMetadata(RouterContainerMagicComponent, [{
4002
2975
  type: Component,
4003
2976
  args: [{
4004
2977
  selector: 'magic-route-outlet',
@@ -4007,15 +2980,9 @@ class RouterContainerMagicComponent {
4007
2980
  }]
4008
2981
  }], function () { return [{ type: ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: ComponentFactoryResolver }, { type: ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null); })();
4009
2982
 
4010
- /**
4011
- * @ignore
4012
- */
4013
2983
  class Constants {
4014
2984
  }
4015
2985
  Constants.DATE_FMT = 'dd/MMM/yyyy';
4016
- /**
4017
- * @ignore
4018
- */
4019
2986
  class DateMagicPipe extends DatePipe {
4020
2987
  constructor(_task) {
4021
2988
  super('en-US');
@@ -4027,7 +2994,6 @@ class DateMagicPipe extends DatePipe {
4027
2994
  let mgDateFormatter = new MgDateFormatter();
4028
2995
  if (!isNullOrUndefined(value) && mask !== null) {
4029
2996
  formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
4030
- // If control is label control of table, due to query mode, then save the format here.
4031
2997
  if (formatStr != null && this._task.isTableControl(controlId)) {
4032
2998
  if (this._task.mgInputDateFormat == null)
4033
2999
  this._task.mgInputDateFormat = formatStr;
@@ -4041,9 +3007,9 @@ class DateMagicPipe extends DatePipe {
4041
3007
  return value;
4042
3008
  }
4043
3009
  }
4044
- /** @nocollapse */ DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
4045
- /** @nocollapse */ DateMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
4046
- /*@__PURE__*/ (function () { ɵsetClassMetadata(DateMagicPipe, [{
3010
+ DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
3011
+ DateMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
3012
+ (function () { ɵsetClassMetadata(DateMagicPipe, [{
4047
3013
  type: Pipe,
4048
3014
  args: [{
4049
3015
  name: 'magicDate'
@@ -4108,17 +3074,11 @@ class MgDateFormatter {
4108
3074
  return formatStr.ToString();
4109
3075
  }
4110
3076
  else
4111
- return "dd-mm-yyyy"; // return default format.
3077
+ return "dd-mm-yyyy";
4112
3078
  }
4113
3079
  }
4114
3080
 
4115
- /**
4116
- * Perform Magic validation on input controls which hold alphanumeric strings
4117
- */
4118
3081
  class MgformatMagicDirective {
4119
- /**
4120
- * @ignore
4121
- */
4122
3082
  constructor(magicDir, _task) {
4123
3083
  this.magicDir = magicDir;
4124
3084
  this._task = _task;
@@ -4126,20 +3086,12 @@ class MgformatMagicDirective {
4126
3086
  ngAfterViewInit() {
4127
3087
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4128
3088
  if (control != null && this._task.mgInputDateFormat == null) {
4129
- // get the first date control's format.
4130
3089
  let pic = this._task.GetControlPictureMask(this.magicDir.id);
4131
3090
  if (pic.getAttr() == StorageAttribute.DATE) {
4132
3091
  this.formatDate(pic);
4133
3092
  }
4134
3093
  }
4135
3094
  }
4136
- /**
4137
- * @ignore
4138
- */
4139
- /**
4140
- * This can be used to set pattern
4141
- * On input, verifies the input matches the required mask
4142
- */
4143
3095
  onFocusEvent($event) {
4144
3096
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4145
3097
  if (control != null) {
@@ -4164,10 +3116,6 @@ class MgformatMagicDirective {
4164
3116
  }
4165
3117
  }
4166
3118
  }
4167
- /**
4168
- * @ignore
4169
- */
4170
- // This can be used to implement uppercase/lower case
4171
3119
  onChangeEvent($event) {
4172
3120
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4173
3121
  let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -4185,9 +3133,6 @@ class MgformatMagicDirective {
4185
3133
  let mgDateFormatter = new MgDateFormatter();
4186
3134
  this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
4187
3135
  }
4188
- /**
4189
- * @ignore
4190
- */
4191
3136
  formatAlphaUnicode(control) {
4192
3137
  let value = control.value;
4193
3138
  if (value !== null && value.length > 0) {
@@ -4213,9 +3158,6 @@ class MgformatMagicDirective {
4213
3158
  control.setValue(valueStr.ToString());
4214
3159
  }
4215
3160
  }
4216
- /**
4217
- * @ignore
4218
- */
4219
3161
  formatBoolean(control) {
4220
3162
  let value = control.value;
4221
3163
  if (value !== null && value.length > 0) {
@@ -4228,12 +3170,6 @@ class MgformatMagicDirective {
4228
3170
  }
4229
3171
  }
4230
3172
  }
4231
- /**
4232
- * @ignore
4233
- */
4234
- /// <summary>
4235
- /// generate pattern from fld's format
4236
- /// </summary>
4237
3173
  generatePattern(attribute, pic) {
4238
3174
  let pattern = "";
4239
3175
  switch (attribute) {
@@ -4247,12 +3183,6 @@ class MgformatMagicDirective {
4247
3183
  }
4248
3184
  return pattern;
4249
3185
  }
4250
- /**
4251
- * @ignore
4252
- */
4253
- /// <summary>
4254
- /// generate pattern for Alpha
4255
- /// </summary>
4256
3186
  generatePatternForNumber(pic) {
4257
3187
  let patternStr = new StringBuilder();
4258
3188
  patternStr.Append("^");
@@ -4265,9 +3195,6 @@ class MgformatMagicDirective {
4265
3195
  patternStr.Append("$");
4266
3196
  return patternStr.ToString();
4267
3197
  }
4268
- /**
4269
- * @ignore
4270
- */
4271
3198
  isPatternGenerationNeeded(attr, pic) {
4272
3199
  switch (attr) {
4273
3200
  case StorageAttribute.NUMERIC:
@@ -4277,12 +3204,6 @@ class MgformatMagicDirective {
4277
3204
  return (pic.getMaskChars() > 0) ? true : false;
4278
3205
  }
4279
3206
  }
4280
- /**
4281
- * @ignore
4282
- */
4283
- /// <summary>
4284
- /// generate pattern for Alpha
4285
- /// </summary>
4286
3207
  generatePatternForAlpha(pic) {
4287
3208
  let cnt = 0;
4288
3209
  let inputAllChars = false;
@@ -4293,7 +3214,6 @@ class MgformatMagicDirective {
4293
3214
  let pattern = new StringBuilder();
4294
3215
  pattern.Append("^");
4295
3216
  for (let i = 0; i < mask.length;) {
4296
- //start new subset , if mask[i] is one of these.
4297
3217
  if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
4298
3218
  || mask.charCodeAt(i) == PICInterface.PIC_X)) {
4299
3219
  pattern.Append("(");
@@ -4339,13 +3259,9 @@ class MgformatMagicDirective {
4339
3259
  pattern.Append("$");
4340
3260
  return pattern.ToString();
4341
3261
  }
4342
- /**
4343
- * @ignore
4344
- */
4345
3262
  getDirectiveCount(mask, idx, pattern, changeInPattern) {
4346
3263
  changeInPattern.value = false;
4347
3264
  let patternCount = 0;
4348
- // find max chars
4349
3265
  while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
4350
3266
  patternCount++;
4351
3267
  idx++;
@@ -4354,9 +3270,6 @@ class MgformatMagicDirective {
4354
3270
  changeInPattern.value = true;
4355
3271
  return patternCount;
4356
3272
  }
4357
- /**
4358
- * @ignore
4359
- */
4360
3273
  IsPatternMatches(mask, pattern) {
4361
3274
  for (let i = 0; i < pattern.length; i++)
4362
3275
  if (mask == pattern[i])
@@ -4364,11 +3277,11 @@ class MgformatMagicDirective {
4364
3277
  return false;
4365
3278
  }
4366
3279
  }
4367
- /** @nocollapse */ MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(ɵɵdirectiveInject(MagicDirective), ɵɵdirectiveInject(TaskMagicService)); };
4368
- /** @nocollapse */ MgformatMagicDirective.ɵdir = ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3280
+ MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(ɵɵdirectiveInject(MagicDirective), ɵɵdirectiveInject(TaskMagicService)); };
3281
+ MgformatMagicDirective.ɵdir = ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
4369
3282
  ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
4370
3283
  } } });
4371
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MgformatMagicDirective, [{
3284
+ (function () { ɵsetClassMetadata(MgformatMagicDirective, [{
4372
3285
  type: Directive,
4373
3286
  args: [{
4374
3287
  selector: '[mgFormat]'
@@ -4381,9 +3294,6 @@ class MgformatMagicDirective {
4381
3294
  args: ['change', ['$event']]
4382
3295
  }] }); })();
4383
3296
 
4384
- /**
4385
- * @ignore
4386
- */
4387
3297
  class TimeMagicPipe extends DatePipe {
4388
3298
  constructor(_task) {
4389
3299
  super('en-US');
@@ -4419,33 +3329,20 @@ class TimeMagicPipe extends DatePipe {
4419
3329
  return value;
4420
3330
  }
4421
3331
  }
4422
- /** @nocollapse */ TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
4423
- /** @nocollapse */ TimeMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
4424
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TimeMagicPipe, [{
3332
+ TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
3333
+ TimeMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
3334
+ (function () { ɵsetClassMetadata(TimeMagicPipe, [{
4425
3335
  type: Pipe,
4426
3336
  args: [{
4427
3337
  name: 'magicTime'
4428
3338
  }]
4429
3339
  }], function () { return [{ type: TaskMagicService }]; }, null); })();
4430
3340
 
4431
- /**
4432
- * Validates the field range.
4433
- */
4434
3341
  class RangeValidatorMagicDirective {
4435
- /**
4436
- *
4437
- * @param _task The task service
4438
- * @param vcRef
4439
- */
4440
3342
  constructor(_task, vcRef) {
4441
3343
  this._task = _task;
4442
3344
  this.vcRef = vcRef;
4443
3345
  }
4444
- /**
4445
- * Validation method
4446
- * @param c FormControl to validate
4447
- * @returns If validation fails, return error message, else returns null
4448
- */
4449
3346
  validate(c) {
4450
3347
  let controlName;
4451
3348
  controlName = this.getControlName(c);
@@ -4467,23 +3364,20 @@ class RangeValidatorMagicDirective {
4467
3364
  };
4468
3365
  }
4469
3366
  }
4470
- /**
4471
- * @ignore
4472
- */
4473
3367
  getControlName(c) {
4474
3368
  const formGroup = c.parent.controls;
4475
3369
  return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
4476
3370
  }
4477
3371
  }
4478
- /** @nocollapse */ RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ViewContainerRef)); };
4479
- /** @nocollapse */ RangeValidatorMagicDirective.ɵdir = ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [ɵɵProvidersFeature([
3372
+ RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ViewContainerRef)); };
3373
+ RangeValidatorMagicDirective.ɵdir = ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [ɵɵProvidersFeature([
4480
3374
  {
4481
3375
  provide: NG_VALIDATORS,
4482
3376
  useExisting: RangeValidatorMagicDirective,
4483
3377
  multi: true,
4484
3378
  }
4485
3379
  ])] });
4486
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RangeValidatorMagicDirective, [{
3380
+ (function () { ɵsetClassMetadata(RangeValidatorMagicDirective, [{
4487
3381
  type: Directive,
4488
3382
  args: [{
4489
3383
  selector: '[rangevalidator] ',
@@ -4503,48 +3397,29 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
4503
3397
  const ctx_r0 = ɵɵnextContext();
4504
3398
  ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
4505
3399
  } }
4506
- /**
4507
- * Represents a Magic subform
4508
- */
4509
3400
  class SubformMagicComponent {
4510
- /**
4511
- * @ignore
4512
- */
4513
3401
  constructor(vcRef, mgSub) {
4514
3402
  this.vcRef = vcRef;
4515
3403
  this.mgSub = mgSub;
4516
- /**
4517
- * @ignore
4518
- */
4519
3404
  this.component = null;
4520
- // For angular 10 - find the component from views
4521
3405
  this.component = (this.vcRef._hostView).find(v => !isNullOrUndefined(v));
4522
3406
  }
4523
- /**
4524
- * @ignore
4525
- */
4526
3407
  set magic(val) { this.id = val; }
4527
3408
  ;
4528
- /**
4529
- * @ignore
4530
- */
4531
3409
  get Component() {
4532
3410
  return this.mgSub.mgGetComp(this.id);
4533
3411
  }
4534
- /**
4535
- * @ignore
4536
- */
4537
3412
  get Parameters() {
4538
3413
  return this.mgSub.mgGetParameters(this.id);
4539
3414
  }
4540
3415
  }
4541
- /** @nocollapse */ SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(SubformMagicService)); };
4542
- /** @nocollapse */ SubformMagicComponent.ɵcmp = ɵɵ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) {
3416
+ SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(SubformMagicService)); };
3417
+ SubformMagicComponent.ɵcmp = ɵɵ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) {
4543
3418
  ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
4544
3419
  } if (rf & 2) {
4545
3420
  ɵɵproperty("ngIf", ctx.Component);
4546
3421
  } }, directives: [NgIf, DynamicComponent, DynamicIoDirective], encapsulation: 2 });
4547
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SubformMagicComponent, [{
3422
+ (function () { ɵsetClassMetadata(SubformMagicComponent, [{
4548
3423
  type: Component,
4549
3424
  args: [{
4550
3425
  selector: 'magic-subform',
@@ -4584,24 +3459,14 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
4584
3459
  ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
4585
3460
  } }
4586
3461
  const _c1$1 = ["*"];
4587
- /**
4588
- * Represents a Magic subform
4589
- */
4590
3462
  class ErrorMagicComponent {
4591
- /**
4592
- * @ignore
4593
- */
4594
3463
  constructor(_task, mgService, changeDetectorRef) {
4595
3464
  this._task = _task;
4596
3465
  this.mgService = mgService;
4597
3466
  this.changeDetectorRef = changeDetectorRef;
4598
- // if true - display standard magic error message, if false - customer has provides his own content and we'll use it
4599
3467
  this.defaultDisplay = true;
4600
3468
  this.rowId = "0";
4601
3469
  }
4602
- /**
4603
- * @ignore
4604
- */
4605
3470
  set magic(val) {
4606
3471
  this.id = val;
4607
3472
  }
@@ -4615,10 +3480,6 @@ class ErrorMagicComponent {
4615
3480
  this.changeDetectorRef.detectChanges();
4616
3481
  }
4617
3482
  ;
4618
- /**
4619
- * returns true if the html element has no children
4620
- * @param element
4621
- */
4622
3483
  isEmpty(element) {
4623
3484
  const nodes = element.childNodes;
4624
3485
  for (let i = 0; i < nodes.length; i++) {
@@ -4629,9 +3490,6 @@ class ErrorMagicComponent {
4629
3490
  }
4630
3491
  return true;
4631
3492
  }
4632
- /**
4633
- * @ignore
4634
- */
4635
3493
  HasErrors(id) {
4636
3494
  if (!isUndefined(id)) {
4637
3495
  let control = this._task.getFormControl(this.rowId, id);
@@ -4653,8 +3511,8 @@ class ErrorMagicComponent {
4653
3511
  return false;
4654
3512
  }
4655
3513
  }
4656
- /** @nocollapse */ ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(AccessorMagicService), ɵɵdirectiveInject(ChangeDetectorRef)); };
4657
- /** @nocollapse */ ErrorMagicComponent.ɵcmp = ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
3514
+ ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(AccessorMagicService), ɵɵdirectiveInject(ChangeDetectorRef)); };
3515
+ ErrorMagicComponent.ɵcmp = ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
4658
3516
  ɵɵviewQuery(_c0$2, true);
4659
3517
  } if (rf & 2) {
4660
3518
  var _t;
@@ -4665,7 +3523,7 @@ class ErrorMagicComponent {
4665
3523
  } if (rf & 2) {
4666
3524
  ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
4667
3525
  } }, directives: [NgIf], encapsulation: 2 });
4668
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ErrorMagicComponent, [{
3526
+ (function () { ɵsetClassMetadata(ErrorMagicComponent, [{
4669
3527
  type: Component,
4670
3528
  args: [{
4671
3529
  selector: 'mgError',
@@ -4690,28 +3548,19 @@ class ErrorMagicComponent {
4690
3548
  args: ['customContent', { static: false }]
4691
3549
  }] }); })();
4692
3550
 
4693
- /**
4694
- * Directive for checkboxes, to handle the 'change' event
4695
- */
4696
3551
  class CheckboxMagicDirective {
4697
- /**
4698
- * @ignore
4699
- */
4700
3552
  constructor(magicDirective) {
4701
3553
  this.magicDirective = magicDirective;
4702
3554
  }
4703
- /**
4704
- * Handles the Checkbox 'change' event - pass it to the Magic engine
4705
- */
4706
3555
  onChange($event) {
4707
3556
  this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
4708
3557
  }
4709
3558
  }
4710
- /** @nocollapse */ CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
4711
- /** @nocollapse */ CheckboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3559
+ CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
3560
+ CheckboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
4712
3561
  ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
4713
3562
  } } });
4714
- /*@__PURE__*/ (function () { ɵsetClassMetadata(CheckboxMagicDirective, [{
3563
+ (function () { ɵsetClassMetadata(CheckboxMagicDirective, [{
4715
3564
  type: Directive,
4716
3565
  args: [{
4717
3566
  selector: `
@@ -4723,25 +3572,19 @@ class CheckboxMagicDirective {
4723
3572
  args: ['change', ['$event']]
4724
3573
  }] }); })();
4725
3574
 
4726
- /**
4727
- * Directive for comboboxes, to handle the 'change' event
4728
- */
4729
3575
  class ComboboxMagicDirective {
4730
3576
  constructor(magicDirective) {
4731
3577
  this.magicDirective = magicDirective;
4732
3578
  }
4733
- /**
4734
- * Handles the Combobox 'change' event - pass it to the Magic engine
4735
- */
4736
3579
  onChange($event) {
4737
3580
  this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
4738
3581
  }
4739
3582
  }
4740
- /** @nocollapse */ ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
4741
- /** @nocollapse */ ComboboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3583
+ ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
3584
+ ComboboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
4742
3585
  ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
4743
3586
  } } });
4744
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ComboboxMagicDirective, [{
3587
+ (function () { ɵsetClassMetadata(ComboboxMagicDirective, [{
4745
3588
  type: Directive,
4746
3589
  args: [{
4747
3590
  selector: `select[magic]:not([multiple])`,
@@ -4751,20 +3594,14 @@ class ComboboxMagicDirective {
4751
3594
  args: ['change', ['$event']]
4752
3595
  }] }); })();
4753
3596
 
4754
- /**
4755
- * This service supports custom actions on magic exit
4756
- */
4757
3597
  class ExitMagicService {
4758
- /**
4759
- * Override this method to implement custom logic on magic exit
4760
- */
4761
3598
  exitMagic() {
4762
3599
  console.log("Magic application terminated");
4763
3600
  }
4764
3601
  }
4765
- /** @nocollapse */ ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
4766
- /** @nocollapse */ ExitMagicService.ɵprov = ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
4767
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ExitMagicService, [{
3602
+ ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
3603
+ ExitMagicService.ɵprov = ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
3604
+ (function () { ɵsetClassMetadata(ExitMagicService, [{
4768
3605
  type: Injectable
4769
3606
  }], null, null); })();
4770
3607
 
@@ -4788,19 +3625,7 @@ function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
4788
3625
  function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
4789
3626
  ɵɵelement(0, "div", 9);
4790
3627
  } }
4791
- /**
4792
- * Root Magic component
4793
- */
4794
3628
  class MagicShellComponent {
4795
- /**
4796
- *
4797
- * @param magic Magic's service
4798
- * @param componentList Magic component list
4799
- * @param changeDetectorRef Changes detector
4800
- * @param titleService Title setting service
4801
- * @param httpClient The native httpClient instance
4802
- * @param exitMagicService Magic exit service
4803
- */
4804
3629
  constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
4805
3630
  this.engineMagicService = engineMagicService;
4806
3631
  this.componentList = componentList;
@@ -4810,32 +3635,22 @@ class MagicShellComponent {
4810
3635
  this.httpClient = httpClient;
4811
3636
  this.pendingCommandsCollector = pendingCommandsCollector;
4812
3637
  this.exitMagicService = exitMagicService;
4813
- /**
4814
- * Root component to be displayed in the window
4815
- */
4816
3638
  this.RootComponent = null;
4817
3639
  this.magicEngineTerminated = false;
4818
3640
  this.initialize();
4819
3641
  this.setTitle();
4820
3642
  }
4821
- /**
4822
- * Before-unload event listener
4823
- * @param event
4824
- */
4825
3643
  onBeforeUnload(event) {
4826
3644
  if (this.engineMagicService.TransCacheExists()) {
4827
- // Show the confirmation box before unloading the browser
4828
3645
  event.returnValue = 'Are you sure?';
4829
3646
  return 'Are you sure?';
4830
3647
  }
4831
3648
  else {
4832
- // terminate the magic server context using fetch API with keep-alive
4833
3649
  this.engineMagicService.TerminateContextUsingFetchAPI();
4834
3650
  this.magicEngineTerminated = true;
4835
3651
  }
4836
3652
  }
4837
3653
  onUnload(event) {
4838
- // Chrome provides an opportunity to terminate the context after user approves the browser unload alert
4839
3654
  if (!this.magicEngineTerminated)
4840
3655
  this.engineMagicService.TerminateContextUsingFetchAPI();
4841
3656
  }
@@ -4846,26 +3661,13 @@ class MagicShellComponent {
4846
3661
  setViewContainerRef(vcRef) {
4847
3662
  this.overlayWindowsContainerViewRef = vcRef;
4848
3663
  }
4849
- /**
4850
- * Initialization of Magic mechanisms
4851
- */
4852
3664
  initialize() {
4853
3665
  this.registerUICommands();
4854
3666
  }
4855
- /**
4856
- * Set the title
4857
- */
4858
3667
  setTitle() {
4859
3668
  const newTitle = this.componentList.title;
4860
3669
  this.titleService.setTitle(newTitle);
4861
3670
  }
4862
- /**
4863
- * Set the component according to requested form
4864
- * @param formName Name of the form to open
4865
- * @param taskId Id of opening task
4866
- * @param taskDescription TODO
4867
- * @param isModal whether modal window is being opened
4868
- */
4869
3671
  setComponent(formName, taskId, taskDescription, isModal) {
4870
3672
  this.pendingCommandsCollector.startCollecting();
4871
3673
  if (isModal) {
@@ -4877,9 +3679,6 @@ class MagicShellComponent {
4877
3679
  }
4878
3680
  this.changeDetectorRef.detectChanges();
4879
3681
  }
4880
- /**
4881
- * @ignore
4882
- */
4883
3682
  registerUICommands() {
4884
3683
  this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
4885
3684
  .subscribe(command => {
@@ -4891,10 +3690,6 @@ class MagicShellComponent {
4891
3690
  GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
4892
3691
  });
4893
3692
  }
4894
- /**
4895
- * Execute commands received from the Magic WebClient engine
4896
- * @param command
4897
- */
4898
3693
  executeCommand(command) {
4899
3694
  switch (command.CommandType) {
4900
3695
  case CommandType.OPEN_FORM:
@@ -4909,7 +3704,7 @@ class MagicShellComponent {
4909
3704
  this.RootComponentParameters = {};
4910
3705
  this.changeDetectorRef.detectChanges();
4911
3706
  }
4912
- else { // Close modal window
3707
+ else {
4913
3708
  this.overlayWindowService.close(command.str);
4914
3709
  this.changeDetectorRef.detectChanges();
4915
3710
  }
@@ -4927,20 +3722,21 @@ class MagicShellComponent {
4927
3722
  if (this.exitMagicService)
4928
3723
  this.exitMagicService.exitMagic();
4929
3724
  break;
3725
+ case CommandType.SHOW_HTML_ERROR:
3726
+ window.document.write(command.str);
3727
+ break;
4930
3728
  }
4931
3729
  }
4932
3730
  }
4933
- /** @nocollapse */ MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(Title), ɵɵdirectiveInject(OverlayWindowService), ɵɵdirectiveInject(HttpClient), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(ExitMagicService, 8)); };
4934
- /** @nocollapse */ MagicShellComponent.ɵcmp = ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
3731
+ MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(Title), ɵɵdirectiveInject(OverlayWindowService), ɵɵdirectiveInject(HttpClient), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(ExitMagicService, 8)); };
3732
+ MagicShellComponent.ɵcmp = ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
4935
3733
  ɵɵstaticViewQuery(_c0$3, true);
4936
3734
  } if (rf & 2) {
4937
3735
  var _t;
4938
3736
  ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
4939
3737
  } }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
4940
3738
  ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, ɵɵresolveWindow);
4941
- } }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [ɵɵProvidersFeature([
4942
- // ExitMagicService
4943
- ])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
3739
+ } }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [ɵɵProvidersFeature([])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
4944
3740
  ɵɵelementStart(0, "div", null, 0);
4945
3741
  ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
4946
3742
  ɵɵelement(3, "div", 2, 3);
@@ -4953,13 +3749,11 @@ class MagicShellComponent {
4953
3749
  ɵɵadvance(3);
4954
3750
  ɵɵproperty("ngIf", ctx.showSpinner);
4955
3751
  } }, directives: [NgIf, MagicViewContainerRef, DynamicComponent, DynamicIoDirective, NgTemplateOutlet], styles: [".mgSpinnerClass[_ngcontent-%COMP%] {\n border: 10px solid #cccccc; \n border-top: 10px solid black; \n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"] });
4956
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicShellComponent, [{
3752
+ (function () { ɵsetClassMetadata(MagicShellComponent, [{
4957
3753
  type: Component,
4958
3754
  args: [{
4959
3755
  selector: 'magic-root',
4960
- providers: [
4961
- // ExitMagicService
4962
- ],
3756
+ providers: [],
4963
3757
  template: `
4964
3758
  <div #magicRoot>
4965
3759
  <ndc-dynamic
@@ -5026,25 +3820,19 @@ class MagicShellComponent {
5026
3820
  args: ['window:unload', ['$event']]
5027
3821
  }] }); })();
5028
3822
 
5029
- /**
5030
- * @ignore
5031
- */
5032
3823
  const CHECKBOX_VALUE_ACCESSOR = {
5033
3824
  provide: NG_VALUE_ACCESSOR,
5034
3825
  useExisting: forwardRef(() => MagicCheckboxControlValueAccessor),
5035
3826
  multi: true,
5036
3827
  };
5037
- /**
5038
- * Value accessor for Checkbox without a FormControl
5039
- */
5040
3828
  class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
5041
3829
  }
5042
- /** @nocollapse */ MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
5043
- /** @nocollapse */ MagicCheckboxControlValueAccessor.ɵdir = ɵɵdefineDirective({ type: MagicCheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "magic", "", 3, "formControlName", "", 3, "no-form-control", ""], ["input", "type", "checkbox", "magic", "", 3, "formControl", ""], ["input", "type", "checkbox", "magic", "", 3, "ngModel", ""]], hostBindings: function MagicCheckboxControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
3830
+ MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
3831
+ MagicCheckboxControlValueAccessor.ɵdir = ɵɵdefineDirective({ type: MagicCheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "magic", "", 3, "formControlName", "", 3, "no-form-control", ""], ["input", "type", "checkbox", "magic", "", 3, "formControl", ""], ["input", "type", "checkbox", "magic", "", 3, "ngModel", ""]], hostBindings: function MagicCheckboxControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
5044
3832
  ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
5045
3833
  } }, features: [ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
5046
- const ɵMagicCheckboxControlValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
5047
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
3834
+ const ɵMagicCheckboxControlValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
3835
+ (function () { ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
5048
3836
  type: Directive,
5049
3837
  args: [{
5050
3838
  selector: `
@@ -5057,25 +3845,19 @@ const ɵMagicCheckboxControlValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInh
5057
3845
  }]
5058
3846
  }], null, null); })();
5059
3847
 
5060
- /**
5061
- * @ignore
5062
- */
5063
3848
  const MAGIC_DEFAULT_VALUE_ACCESSOR = {
5064
3849
  provide: NG_VALUE_ACCESSOR,
5065
3850
  useExisting: forwardRef(() => MagicDefaultValueAccessor),
5066
3851
  multi: true
5067
3852
  };
5068
- /**
5069
- * @ignore
5070
- */
5071
3853
  class MagicDefaultValueAccessor extends DefaultValueAccessor {
5072
3854
  }
5073
- /** @nocollapse */ MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
5074
- /** @nocollapse */ MagicDefaultValueAccessor.ɵdir = ɵɵdefineDirective({ type: MagicDefaultValueAccessor, selectors: [["input", "magic", "", 3, "type", "checkbox", 3, "formControlName", "", 3, "no-form-control", ""], ["textarea", "magic", "", 3, "formControlName", "", 3, "noFormControl", "", 3, "no-form-control", ""]], hostBindings: function MagicDefaultValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
3855
+ MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
3856
+ MagicDefaultValueAccessor.ɵdir = ɵɵdefineDirective({ type: MagicDefaultValueAccessor, selectors: [["input", "magic", "", 3, "type", "checkbox", 3, "formControlName", "", 3, "no-form-control", ""], ["textarea", "magic", "", 3, "formControlName", "", 3, "noFormControl", "", 3, "no-form-control", ""]], hostBindings: function MagicDefaultValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
5075
3857
  ɵɵlistener("input", function MagicDefaultValueAccessor_input_HostBindingHandler($event) { return ctx._handleInput($event.target.value); })("blur", function MagicDefaultValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); })("compositionstart", function MagicDefaultValueAccessor_compositionstart_HostBindingHandler() { return ctx._compositionStart(); })("compositionend", function MagicDefaultValueAccessor_compositionend_HostBindingHandler($event) { return ctx._compositionEnd($event.target.value); });
5076
3858
  } }, exportAs: ["magic"], features: [ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
5077
- const ɵMagicDefaultValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
5078
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicDefaultValueAccessor, [{
3859
+ const ɵMagicDefaultValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
3860
+ (function () { ɵsetClassMetadata(MagicDefaultValueAccessor, [{
5079
3861
  type: Directive,
5080
3862
  args: [{
5081
3863
  selector: `
@@ -5093,25 +3875,19 @@ const ɵMagicDefaultValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFa
5093
3875
  }]
5094
3876
  }], null, null); })();
5095
3877
 
5096
- /**
5097
- * Directive for checkboxes which should not have a form control
5098
- */
5099
3878
  class CheckboxNoFormControlMagicDirective {
5100
3879
  constructor(magicDirective) {
5101
3880
  this.magicDirective = magicDirective;
5102
3881
  }
5103
- /**
5104
- * Handle the 'Checkbox' change event - pass it to the Magic engine
5105
- */
5106
3882
  onChange($event) {
5107
3883
  this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
5108
3884
  }
5109
3885
  }
5110
- /** @nocollapse */ CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
5111
- /** @nocollapse */ CheckboxNoFormControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3886
+ CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
3887
+ CheckboxNoFormControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
5112
3888
  ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5113
3889
  } } });
5114
- /*@__PURE__*/ (function () { ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
3890
+ (function () { ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
5115
3891
  type: Directive,
5116
3892
  args: [{
5117
3893
  selector: `
@@ -5123,25 +3899,19 @@ class CheckboxNoFormControlMagicDirective {
5123
3899
  args: ['change', ['$event']]
5124
3900
  }] }); })();
5125
3901
 
5126
- /**
5127
- * Directive for non-checkbox input controls which do not have a form control
5128
- */
5129
3902
  class InputNoFormControlMagicDirective {
5130
3903
  constructor(magicDirective) {
5131
3904
  this.magicDirective = magicDirective;
5132
3905
  }
5133
- /**
5134
- * Handles the 'change' event - pass it to the Magic engine
5135
- */
5136
3906
  onChange($event) {
5137
3907
  this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
5138
3908
  }
5139
3909
  }
5140
- /** @nocollapse */ InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
5141
- /** @nocollapse */ InputNoFormControlMagicDirective.ɵdir = ɵɵ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) {
3910
+ InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
3911
+ InputNoFormControlMagicDirective.ɵdir = ɵɵ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) {
5142
3912
  ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5143
3913
  } } });
5144
- /*@__PURE__*/ (function () { ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
3914
+ (function () { ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
5145
3915
  type: Directive,
5146
3916
  args: [{
5147
3917
  selector: `input[magic]:([noFormControl]):not([type=checkbox]),
@@ -5157,14 +3927,6 @@ const DATE_VALUE_ACCESSOR = {
5157
3927
  useExisting: forwardRef(() => DateValueAccessor),
5158
3928
  multi: true
5159
3929
  };
5160
- /**
5161
- * The accessor for writing a value and listening to changes on a date input element
5162
- *
5163
- * ### Example
5164
- * `<input type="date" name="birthday" ngModel dateInput>`
5165
- * OR
5166
- * `<input type="date" formControlName="birthday" dateInput>`
5167
- */
5168
3930
  class DateValueAccessor {
5169
3931
  constructor(renderer, elementRef) {
5170
3932
  this.renderer = renderer;
@@ -5172,7 +3934,6 @@ class DateValueAccessor {
5172
3934
  this.onChange = (_) => { };
5173
3935
  this.onTouched = () => { };
5174
3936
  }
5175
- /** Writes a new value to the element (model -> view) */
5176
3937
  writeValue(value) {
5177
3938
  if (!value) {
5178
3939
  this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
@@ -5180,26 +3941,23 @@ class DateValueAccessor {
5180
3941
  }
5181
3942
  this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
5182
3943
  }
5183
- /** Registers a callback function, called when value changes (view -> model) */
5184
3944
  registerOnChange(fn) {
5185
3945
  this.onChange = v => fn(v instanceof Date
5186
3946
  ? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
5187
3947
  : v);
5188
3948
  }
5189
- /** Registers a callback function, called when the control is blurred */
5190
3949
  registerOnTouched(fn) {
5191
3950
  this.onTouched = fn;
5192
3951
  }
5193
- /** Enables or disables the element when the control status changes */
5194
3952
  setDisabledState(isDisabled) {
5195
3953
  this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
5196
3954
  }
5197
3955
  }
5198
- /** @nocollapse */ DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ElementRef)); };
5199
- /** @nocollapse */ DateValueAccessor.ɵdir = ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
3956
+ DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ElementRef)); };
3957
+ DateValueAccessor.ɵdir = ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
5200
3958
  ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
5201
3959
  } }, features: [ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
5202
- /*@__PURE__*/ (function () { ɵsetClassMetadata(DateValueAccessor, [{
3960
+ (function () { ɵsetClassMetadata(DateValueAccessor, [{
5203
3961
  type: Directive,
5204
3962
  args: [{
5205
3963
  selector: "[dateInput]",
@@ -5213,25 +3971,12 @@ class DateValueAccessor {
5213
3971
  args: ["blur", []]
5214
3972
  }] }); })();
5215
3973
 
5216
- /**
5217
- * Responsible for connecting HTML elements to the Magic WebClient engine showing it is not Magic Control but a Dummy control which is used to notify only receeive focus event for now
5218
- */
5219
3974
  class NonMagicControlDirective {
5220
- /**
5221
- *
5222
- * @param _task The task service
5223
- * @param element The element for which the directive is applied
5224
- * @param renderer Renderer for the element
5225
- * @param vcRef
5226
- */
5227
3975
  constructor(_task, element, renderer, vcRef) {
5228
3976
  this._task = _task;
5229
3977
  this.element = element;
5230
3978
  this.renderer = renderer;
5231
3979
  this.vcRef = vcRef;
5232
- /**
5233
- * Collection of event handlers for this element
5234
- */
5235
3980
  this.eventHandlers = {};
5236
3981
  this.eventsOnlyVal = false;
5237
3982
  this.htmlElement = this.element.nativeElement;
@@ -5241,40 +3986,26 @@ class NonMagicControlDirective {
5241
3986
  this.selector = 'NonMagicControl';
5242
3987
  }
5243
3988
  ;
5244
- /**
5245
- * Get the task service
5246
- * @returns
5247
- */
5248
3989
  get task() {
5249
3990
  return this._task;
5250
3991
  }
5251
- /**
5252
- * Register to the events this element may need to handle
5253
- */
5254
3992
  regEvents() {
5255
- // Handle events for which event handler may be removed and restored
5256
3993
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
5257
3994
  Object.keys(this.eventHandlers).forEach((key) => {
5258
3995
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
5259
3996
  });
5260
3997
  }
5261
- /**
5262
- * Handle focus event
5263
- */
5264
3998
  OnFocus() {
5265
3999
  this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', "", -1));
5266
4000
  event.cancelBubble = true;
5267
4001
  }
5268
- /**
5269
- * Initialize this object
5270
- */
5271
4002
  ngOnInit() {
5272
4003
  this.regEvents();
5273
4004
  }
5274
4005
  }
5275
- /** @nocollapse */ NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef)); };
5276
- /** @nocollapse */ NonMagicControlDirective.ɵdir = ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
5277
- /*@__PURE__*/ (function () { ɵsetClassMetadata(NonMagicControlDirective, [{
4006
+ NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef)); };
4007
+ NonMagicControlDirective.ɵdir = ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
4008
+ (function () { ɵsetClassMetadata(NonMagicControlDirective, [{
5278
4009
  type: Directive,
5279
4010
  args: [{
5280
4011
  selector: '[NonMagicControl]'
@@ -5284,9 +4015,6 @@ class NonMagicControlDirective {
5284
4015
  args: ['NonMagicControl']
5285
4016
  }] }); })();
5286
4017
 
5287
- /**
5288
- * @ignore
5289
- */
5290
4018
  const decs = [
5291
4019
  MagicDirective,
5292
4020
  CheckboxMagicDirective,
@@ -5317,9 +4045,6 @@ const decs = [
5317
4045
  MagicFocusDirective,
5318
4046
  MagicViewContainerRef
5319
4047
  ];
5320
- /**
5321
- * @ignore
5322
- */
5323
4048
  class MagicModule {
5324
4049
  static forRoot() {
5325
4050
  return {
@@ -5334,12 +4059,11 @@ class MagicModule {
5334
4059
  };
5335
4060
  }
5336
4061
  }
5337
- /** @nocollapse */ MagicModule.ɵmod = ɵɵdefineNgModule({ type: MagicModule });
5338
- /** @nocollapse */ MagicModule.ɵinj = ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
4062
+ MagicModule.ɵmod = ɵɵdefineNgModule({ type: MagicModule });
4063
+ MagicModule.ɵinj = ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
5339
4064
  CommonModule,
5340
4065
  FormsModule,
5341
4066
  ReactiveFormsModule,
5342
- //ThemeModule,
5343
4067
  RouterModule,
5344
4068
  DynamicModule,
5345
4069
  HttpClientModule
@@ -5374,7 +4098,6 @@ class MagicModule {
5374
4098
  MagicViewContainerRef], imports: [CommonModule,
5375
4099
  FormsModule,
5376
4100
  ReactiveFormsModule,
5377
- //ThemeModule,
5378
4101
  RouterModule,
5379
4102
  DynamicModule,
5380
4103
  HttpClientModule], exports: [MagicDirective,
@@ -5405,7 +4128,7 @@ class MagicModule {
5405
4128
  NonMagicControlDirective,
5406
4129
  MagicFocusDirective,
5407
4130
  MagicViewContainerRef] }); })();
5408
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MagicModule, [{
4131
+ (function () { ɵsetClassMetadata(MagicModule, [{
5409
4132
  type: NgModule,
5410
4133
  args: [{
5411
4134
  declarations: [...decs],
@@ -5415,12 +4138,10 @@ class MagicModule {
5415
4138
  CommonModule,
5416
4139
  FormsModule,
5417
4140
  ReactiveFormsModule,
5418
- //ThemeModule,
5419
4141
  RouterModule,
5420
4142
  DynamicModule,
5421
4143
  HttpClientModule
5422
4144
  ],
5423
- //Customizable providers
5424
4145
  providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
5425
4146
  }]
5426
4147
  }], null, null); })();
@@ -5508,7 +4229,7 @@ class MgDateAdapter extends NativeDateAdapter {
5508
4229
  this.mgdtfmt = this.task.mgInputDateFormat;
5509
4230
  if (displayFormat === 'input') {
5510
4231
  if (this.mgdtfmt == null)
5511
- this.mgdtfmt = 'M/d/yyyy'; //default format
4232
+ this.mgdtfmt = 'M/d/yyyy';
5512
4233
  return formatDate(date, this.mgdtfmt, this.locale);
5513
4234
  }
5514
4235
  else {
@@ -5516,9 +4237,9 @@ class MgDateAdapter extends NativeDateAdapter {
5516
4237
  }
5517
4238
  }
5518
4239
  }
5519
- /** @nocollapse */ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(ɵɵinject(Platform), ɵɵinject(TaskMagicService)); };
5520
- /** @nocollapse */ MgDateAdapter.ɵprov = ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
5521
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MgDateAdapter, [{
4240
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(ɵɵinject(Platform), ɵɵinject(TaskMagicService)); };
4241
+ MgDateAdapter.ɵprov = ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4242
+ (function () { ɵsetClassMetadata(MgDateAdapter, [{
5522
4243
  type: Injectable
5523
4244
  }], function () { return [{ type: Platform }, { type: TaskMagicService }]; }, null); })();
5524
4245
 
@@ -5526,9 +4247,6 @@ const matDateProviders = [
5526
4247
  { provide: DateAdapter, useClass: MgDateAdapter },
5527
4248
  { provide: MAT_DATE_FORMATS, useValue: MG_FORMATS }
5528
4249
  ];
5529
- /**
5530
- * Magic service providers
5531
- */
5532
4250
  const basicMagicProviders = [
5533
4251
  MagicServices,
5534
4252
  TaskMagicService,
@@ -5542,18 +4260,7 @@ const magicProviders = [
5542
4260
  TableMagicService
5543
4261
  ];
5544
4262
 
5545
- /**
5546
- * @ignore
5547
- */
5548
- ///////////////////////////////////////////////////////////
5549
- // class to hold gui-related helper methods
5550
- ///////////////////////////////////////////////////////////
5551
4263
  class utils {
5552
- ///////////////////////////////////////////////////////////
5553
- // Add magic child control to the supplied array.
5554
- // Recursive, and checks children even if they are not magic controls.
5555
- // Magic controls are controls which have a magic directive attached to them.
5556
- ///////////////////////////////////////////////////////////
5557
4264
  static addChildren(parent, children, selector) {
5558
4265
  for (var i = 0; i < parent.children.length; i++) {
5559
4266
  if (typeof parent.children[i].attributes[selector] !== "undefined") {
@@ -5562,9 +4269,6 @@ class utils {
5562
4269
  this.addChildren(parent.children[i], children, selector);
5563
4270
  }
5564
4271
  }
5565
- ///////////////////////////////////////////////////////////
5566
- // Calculate the distance between the control and the supplied x,y coordinates
5567
- ///////////////////////////////////////////////////////////
5568
4272
  static getDistance(control, x, y) {
5569
4273
  let left = control.clientLeft, top = control.clientTop;
5570
4274
  let dx, dy;
@@ -5591,9 +4295,6 @@ class utils {
5591
4295
  const ret = (dx * dx + dy * dy);
5592
4296
  return ret;
5593
4297
  }
5594
- ///////////////////////////////////////////////////////////
5595
- //
5596
- ///////////////////////////////////////////////////////////
5597
4298
  static getDimentions(el) {
5598
4299
  let xPos = 0;
5599
4300
  let yPos = 0;
@@ -5601,14 +4302,12 @@ class utils {
5601
4302
  let height = el.height;
5602
4303
  while (el) {
5603
4304
  if (el.tagName == "BODY") {
5604
- // deal with browser quirks with body/window/document and page scroll
5605
4305
  let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
5606
4306
  let yScroll = el.scrollTop || document.documentElement.scrollTop;
5607
4307
  xPos += (el.offsetLeft - xScroll + el.clientLeft);
5608
4308
  yPos += (el.offsetTop - yScroll + el.clientTop);
5609
4309
  }
5610
4310
  else {
5611
- // for all other non-BODY elements
5612
4311
  xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
5613
4312
  yPos += (el.offsetTop - el.scrollTop + el.clientTop);
5614
4313
  }
@@ -5623,9 +4322,6 @@ class utils {
5623
4322
  }
5624
4323
  }
5625
4324
 
5626
- /**
5627
- * @ignore
5628
- */
5629
4325
  class ModalFormDefinition {
5630
4326
  constructor() {
5631
4327
  this.taskId = "";
@@ -5634,9 +4330,5 @@ class ModalFormDefinition {
5634
4330
  }
5635
4331
  }
5636
4332
 
5637
- /**
5638
- * Generated bundle index. Do not edit.
5639
- */
5640
-
5641
4333
  export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_DEFAULT_VALUE_ACCESSOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
5642
4334
  //# sourceMappingURL=magic-xpa-angular.js.map