@magic-xpa/angular 4.800.0-dev480.16 → 4.800.0-dev480.163

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 +218 -1515
  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 +39 -249
  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 +25 -51
  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 +8 -81
  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 +218 -1519
  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 +15 -208
  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 +5 -30
  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
@@ -296,21 +296,16 @@
296
296
  return value;
297
297
  }
298
298
 
299
- /**
300
- * @ignore
301
- */
302
299
  var ControlMetadata = /** @class */ (function () {
303
300
  function ControlMetadata() {
304
301
  this.properties = new Map();
305
302
  this.classesMap = new Map();
306
303
  this.stylesMap = new Map();
307
- // user properties
308
304
  this.userProperties = new Map();
309
305
  this.customValidators = new Map();
310
306
  }
311
307
  ControlMetadata.prototype.setClass = function (key, value) {
312
308
  var e_1, _a;
313
- // for no-control - hold the name of the class to be removed later
314
309
  if (this.classesMap.has(key)) {
315
310
  this.removedClass = this.classesMap.get(key);
316
311
  }
@@ -336,14 +331,9 @@
336
331
  };
337
332
  return ControlMetadata;
338
333
  }());
339
- /**
340
- * @ignore
341
- */
342
334
  var ControlsMetadata = /** @class */ (function () {
343
335
  function ControlsMetadata() {
344
- //values of control
345
336
  this.values = new Map();
346
- // dictionary of controls with there properties
347
337
  this.ControlsProperties = new Map();
348
338
  this.isCreated = false;
349
339
  this.isEditing = false;
@@ -361,8 +351,6 @@
361
351
  return this.ControlsProperties.get(controlId);
362
352
  };
363
353
  ControlsMetadata.prototype.update = function (obj) {
364
- //should we keep the values here ?
365
- //this.values = obj.ControlsValues;
366
354
  var props = obj.ControlsMetaData;
367
355
  for (var controlName in props) {
368
356
  if (!this.ControlsProperties.has(controlName))
@@ -392,16 +380,13 @@
392
380
  };
393
381
  return ControlsMetadata;
394
382
  }());
395
- /**
396
- * @ignore
397
- */
398
383
  var Records = /** @class */ (function () {
399
384
  function Records() {
400
385
  this.data = new Map();
401
- this.list = []; //used for sequential access in table
386
+ this.list = [];
402
387
  this.recordsBeforeCurrentView = 0;
403
388
  this.isEmptyDataView = false;
404
- this.sizeUpdated = false; //used for evaluating the RecordsSizeChange.
389
+ this.sizeUpdated = false;
405
390
  }
406
391
  Records.prototype.getRow = function (dvRowId) {
407
392
  return this.list[dvRowId + this.recordsBeforeCurrentView];
@@ -425,24 +410,14 @@
425
410
  }
426
411
  return false;
427
412
  };
428
- /*
429
- * for row editing
430
- * */
431
413
  Records.prototype.startRowEditing = function (guiRowId) {
432
414
  if (guiRowId < this.list.length && this.data.has(guiRowId))
433
415
  this.data.get(guiRowId).isEditing = true;
434
416
  };
435
- /*
436
- * stop row editing on row Id
437
- * */
438
417
  Records.prototype.stopRowEditing = function (guiRowId) {
439
418
  if (guiRowId < this.list.length && this.data.has(guiRowId))
440
419
  this.data.get(guiRowId).isEditing = false;
441
420
  };
442
- /*
443
- * return if row is in editing
444
- * Called by the HTML code, so parameter is a string, not a numebr
445
- * */
446
421
  Records.prototype.isRowInRowEditing = function (guiRowId) {
447
422
  if (+guiRowId < this.list.length) {
448
423
  if (!this.data.has(+guiRowId) || util.isNullOrUndefined(this.data.get(+guiRowId)))
@@ -482,7 +457,6 @@
482
457
  Records.prototype.updateSize = function (len) {
483
458
  if (this.list.length != len) {
484
459
  if (len < this.list.length) {
485
- //remove rows
486
460
  for (var i = len; i < this.list.length; i++) {
487
461
  this.data.delete(i);
488
462
  }
@@ -491,10 +465,6 @@
491
465
  this.sizeUpdated = true;
492
466
  }
493
467
  };
494
- /**
495
- * crears data for the first record
496
- * @param template
497
- */
498
468
  Records.prototype.clearFirstTableRecord = function (template) {
499
469
  if (this.list.length >= 1) {
500
470
  for (var key in template) {
@@ -533,16 +503,11 @@
533
503
  HtmlClasses["HintColor"] = "hintcolor";
534
504
  })(exports.HtmlClasses || (exports.HtmlClasses = {}));
535
505
 
536
- /**
537
- * @ignore
538
- */
539
506
  var EngineMagicService = /** @class */ (function () {
540
507
  function EngineMagicService() {
541
508
  this.magicBridge = engine.MagicBridge;
542
509
  this.isStub = false;
543
- // true when user is logged in magic
544
510
  this.isLoggedIn = false;
545
- //TODO - unregister
546
511
  this.refreshDom = new rxjs.Subject();
547
512
  this.interactiveCommands = new rxjs.Subject();
548
513
  }
@@ -604,6 +569,9 @@
604
569
  EngineMagicService.prototype.GetControlPictureMask = function (taskId, controlName) {
605
570
  return this.magicBridge.GetControlPictureMask(taskId, controlName);
606
571
  };
572
+ EngineMagicService.prototype.GetFormattedValue = function (taskId, controlName, value) {
573
+ return this.magicBridge.GetFormattedValue(taskId, controlName, value);
574
+ };
607
575
  EngineMagicService.prototype.ValidateControlValue = function (taskId, controlName, value) {
608
576
  return this.magicBridge.ValidateControlValue(taskId, controlName, value);
609
577
  };
@@ -611,7 +579,6 @@
611
579
  return this.magicBridge.GetFldRanges(taskId, controlName);
612
580
  };
613
581
  EngineMagicService.prototype.saveData = function (data) {
614
- //this.magicBridge.saveData(data);
615
582
  };
616
583
  EngineMagicService.prototype.getIsLoggedIn = function () {
617
584
  return this.isLoggedIn;
@@ -627,26 +594,17 @@
627
594
  };
628
595
  return EngineMagicService;
629
596
  }());
630
- /** @nocollapse */ EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
631
- /** @nocollapse */ EngineMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
632
- /*@__PURE__*/ (function () {
597
+ EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
598
+ EngineMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
599
+ (function () {
633
600
  i0.ɵsetClassMetadata(EngineMagicService, [{
634
601
  type: i0.Injectable
635
602
  }], null, null);
636
603
  })();
637
604
 
638
- /**
639
- * Manages the list of components in a project, and the project title
640
- */
641
605
  var ComponentListMagicService = /** @class */ (function () {
642
606
  function ComponentListMagicService() {
643
- /**
644
- * Map of project components
645
- */
646
607
  this.components = new Map();
647
- /**
648
- * Map of project dialogs
649
- */
650
608
  this.dialogs = new Map();
651
609
  this.lazyLoadModulesMap = null;
652
610
  }
@@ -660,11 +618,6 @@
660
618
  data = this.components.get(name);
661
619
  return data;
662
620
  };
663
- /**
664
- * Return a component according to name
665
- * @param name Name of requested component
666
- * @returns The requested component
667
- */
668
621
  ComponentListMagicService.prototype.getComponent = function (name, mustHaveData) {
669
622
  if (mustHaveData === void 0) { mustHaveData = true; }
670
623
  var data = this.getData(name, mustHaveData);
@@ -676,30 +629,17 @@
676
629
  this.components.set(key, data);
677
630
  }
678
631
  };
679
- /**
680
- * Return a component according to name
681
- * @param name Name of requested component
682
- * @returns The requested component
683
- */
684
632
  ComponentListMagicService.prototype.getModuleRef = function (name) {
685
633
  var data = this.getData(name, false);
686
634
  return data ? data.moduleRef : null;
687
635
  ;
688
636
  };
689
- /**
690
- * Return the lazy load module details of the specified component
691
- * @param name: Name of requested component
692
- * @returns: lazy load module details
693
- */
694
637
  ComponentListMagicService.prototype.getLazyLoadModuleData = function (name) {
695
638
  return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
696
639
  };
697
640
  return ComponentListMagicService;
698
641
  }());
699
642
 
700
- /**
701
- * @ignore
702
- */
703
643
  var StylesMapManager = /** @class */ (function () {
704
644
  function StylesMapManager() {
705
645
  }
@@ -729,14 +669,10 @@
729
669
  [utils$1.MagicProperties.Wallpaper, "background-image"]
730
670
  ]);
731
671
 
732
- /**
733
- * @ignore
734
- */
735
672
  var GuiInteractiveExecutor = /** @class */ (function () {
736
673
  function GuiInteractiveExecutor() {
737
674
  }
738
675
  GuiInteractiveExecutor.prototype.Run = function () {
739
- // Sets the currentContextID
740
676
  try {
741
677
  switch (this.command._commandType) {
742
678
  case gui.InteractiveCommandType.GET_VALUE:
@@ -767,7 +703,6 @@
767
703
  }
768
704
  catch (ex) {
769
705
  throw ex;
770
- //want to see all the exceptions for now
771
706
  }
772
707
  };
773
708
  GuiInteractiveExecutor.executeInteractiveCommand = function (task, guiIntactiveCommand, overlayService) {
@@ -848,30 +783,18 @@
848
783
  i0.Output()
849
784
  ], exports.BaseMagicOverlayContainer);
850
785
 
851
- /**
852
- * This is a base class for the magic confirm components
853
- */
854
786
  var BaseMagicConfirmComponent = /** @class */ (function () {
855
787
  function BaseMagicConfirmComponent() {
856
- /**
857
- * onClose Event - to be raised when the component is closed
858
- * should pass true when OK is pressed and false when cancel is pressed
859
- */
860
788
  this.onClose = new i0.EventEmitter();
861
789
  }
862
- /**
863
- * raises close Event
864
- * @param result true when OK is pressed and false when cancel is pressed
865
- *
866
- */
867
790
  BaseMagicConfirmComponent.prototype.OnClose = function (result) {
868
791
  this.onClose.emit(result);
869
792
  };
870
793
  return BaseMagicConfirmComponent;
871
794
  }());
872
- /** @nocollapse */ BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
873
- /** @nocollapse */ BaseMagicConfirmComponent.ɵcmp = i0.ɵɵ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: [""] });
874
- /*@__PURE__*/ (function () {
795
+ BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
796
+ BaseMagicConfirmComponent.ɵcmp = i0.ɵɵ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: [""] });
797
+ (function () {
875
798
  i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
876
799
  type: i0.Component,
877
800
  args: [{
@@ -888,28 +811,18 @@
888
811
  }] });
889
812
  })();
890
813
 
891
- /**
892
- * This is a base class for the magic alert components
893
- */
894
814
  var BaseMagicAlertComponent = /** @class */ (function () {
895
815
  function BaseMagicAlertComponent() {
896
- /**
897
- * onClose Event - to be raised when the component is closed
898
-
899
- */
900
816
  this.onClose = new i0.EventEmitter();
901
817
  }
902
- /**
903
- * close magic alert
904
- */
905
818
  BaseMagicAlertComponent.prototype.OnClose = function () {
906
819
  this.onClose.emit();
907
820
  };
908
821
  return BaseMagicAlertComponent;
909
822
  }());
910
- /** @nocollapse */ BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
911
- /** @nocollapse */ BaseMagicAlertComponent.ɵcmp = i0.ɵɵ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: [""] });
912
- /*@__PURE__*/ (function () {
823
+ BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
824
+ BaseMagicAlertComponent.ɵcmp = i0.ɵɵ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: [""] });
825
+ (function () {
913
826
  i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
914
827
  type: i0.Component,
915
828
  args: [{
@@ -926,9 +839,6 @@
926
839
  }] });
927
840
  })();
928
841
 
929
- /**
930
- * Directive for setting focus on element
931
- */
932
842
  var MagicFocusDirective = /** @class */ (function () {
933
843
  function MagicFocusDirective(hostElement) {
934
844
  this.hostElement = hostElement;
@@ -938,9 +848,9 @@
938
848
  };
939
849
  return MagicFocusDirective;
940
850
  }());
941
- /** @nocollapse */ MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
942
- /** @nocollapse */ MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
943
- /*@__PURE__*/ (function () {
851
+ MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
852
+ MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
853
+ (function () {
944
854
  i0.ɵsetClassMetadata(MagicFocusDirective, [{
945
855
  type: i0.Directive,
946
856
  args: [{
@@ -949,22 +859,18 @@
949
859
  }], function () { return [{ type: i0.ElementRef }]; }, null);
950
860
  })();
951
861
 
952
- /**
953
- * Directive for setting ViewContainerRef on element
954
- */
955
862
  var MagicViewContainerRef = /** @class */ (function () {
956
863
  function MagicViewContainerRef(vcRef, resolver) {
957
864
  this.vcRef = vcRef;
958
865
  this.resolver = resolver;
959
- // For angular 10 - find the component from the views
960
866
  var comp = (this.vcRef._hostView).find(function (v) { return v != null && !util.isNullOrUndefined(v.setViewContainerRef); });
961
867
  comp.setViewContainerRef(vcRef);
962
868
  }
963
869
  return MagicViewContainerRef;
964
870
  }());
965
- /** @nocollapse */ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
966
- /** @nocollapse */ MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
967
- /*@__PURE__*/ (function () {
871
+ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
872
+ MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
873
+ (function () {
968
874
  i0.ɵsetClassMetadata(MagicViewContainerRef, [{
969
875
  type: i0.Directive,
970
876
  args: [{
@@ -975,29 +881,16 @@
975
881
 
976
882
  var _c0 = ["overlayContainerWrapper"];
977
883
  var MagicOverlayContainerWrapper = /** @class */ (function () {
978
- /**
979
- *
980
- * @param componentFactoryResolver
981
- */
982
884
  function MagicOverlayContainerWrapper(componentListMagicService, loader, injector, componentFactoryResolver, changeDetectorRef) {
983
885
  this.componentListMagicService = componentListMagicService;
984
886
  this.loader = loader;
985
887
  this.injector = injector;
986
888
  this.componentFactoryResolver = componentFactoryResolver;
987
889
  this.changeDetectorRef = changeDetectorRef;
988
- /**
989
- *
990
- */
991
890
  this.Component = null;
992
- /**
993
- *
994
- */
995
891
  this.Parameters = {};
996
892
  this.onClose = new i0.EventEmitter();
997
893
  }
998
- /**
999
- *
1000
- */
1001
894
  MagicOverlayContainerWrapper.prototype.ngOnInit = function () {
1002
895
  var _this = this;
1003
896
  var moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
@@ -1050,17 +943,13 @@
1050
943
  };
1051
944
  return MagicOverlayContainerWrapper;
1052
945
  }());
1053
- /**
1054
- * @ignore
1055
- * contais data of allowed base components to use
1056
- */
1057
946
  MagicOverlayContainerWrapper.allowedBaseComps = new Map([
1058
947
  [gui.OverlayType.Overlay, { comp: exports.BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
1059
948
  [gui.OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
1060
949
  [gui.OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
1061
950
  ]);
1062
- /** @nocollapse */ MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.NgModuleFactoryLoader), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
1063
- /** @nocollapse */ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) {
951
+ MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.NgModuleFactoryLoader), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
952
+ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) {
1064
953
  if (rf & 1) {
1065
954
  i0.ɵɵstaticViewQuery(_c0, true);
1066
955
  }
@@ -1079,7 +968,7 @@
1079
968
  i0.ɵɵelementEnd();
1080
969
  }
1081
970
  }, 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 }"] });
1082
- /*@__PURE__*/ (function () {
971
+ (function () {
1083
972
  i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
1084
973
  type: i0.Component,
1085
974
  args: [{
@@ -1101,17 +990,10 @@
1101
990
  }] });
1102
991
  })();
1103
992
 
1104
- /**
1105
- * Displays a message-box
1106
- */
1107
993
  var confirmationBox = /** @class */ (function () {
1108
994
  function confirmationBox() {
1109
995
  }
1110
- /**
1111
- * @ignore
1112
- */
1113
996
  confirmationBox.isConfirmBox = function (style) {
1114
- // button format mask is in first nibble from right
1115
997
  var buttonMode = style & 0x0F;
1116
998
  var isConfirm = (buttonMode === gui.Styles.MSGBOX_BUTTON_OK_CANCEL) ||
1117
999
  (buttonMode === gui.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
@@ -1120,14 +1002,7 @@
1120
1002
  (buttonMode === gui.Styles.MSGBOX_BUTTON_RETRY_CANCEL);
1121
1003
  return (isConfirm);
1122
1004
  };
1123
- /**
1124
- * Converts the result from the HTML window to the expected result type
1125
- * @param style Result received from HTML window
1126
- * @param okWasPressed Was the "OK" pressed
1127
- * @returns MessageBox result type
1128
- */
1129
1005
  confirmationBox.convertToExcpectedResultBox = function (style, okWasPressed) {
1130
- // button format mask is in first nibble from right
1131
1006
  var buttonMode = style & 0x0F;
1132
1007
  var retValue = gui.Styles.MSGBOX_RESULT_OK;
1133
1008
  if (buttonMode === gui.Styles.MSGBOX_BUTTON_OK)
@@ -1144,19 +1019,10 @@
1144
1019
  retValue = okWasPressed ? gui.Styles.MSGBOX_RESULT_RETRY : gui.Styles.MSGBOX_RESULT_CANCEL;
1145
1020
  return retValue;
1146
1021
  };
1147
- /**
1148
- * Show a message box as an HTML window
1149
- * @param title Title of the message box
1150
- * @param message Message that will be display in the message box
1151
- * @param style Style that include buttons \ Icons
1152
- * @returns MessageBox result
1153
- */
1154
1022
  confirmationBox.showConfirmationBox = function (title, message, style) {
1155
1023
  var okWasPressed = false;
1156
1024
  var retValue = gui.Styles.MSGBOX_RESULT_OK;
1157
- // check if it is confirmation box
1158
1025
  var isConfirm = this.isConfirmBox(style);
1159
- // the title will be added to the string and we will add new line after the title
1160
1026
  var titleAndString = title + '\n' + '\n' + message;
1161
1027
  if (isConfirm)
1162
1028
  okWasPressed = confirm(titleAndString);
@@ -1164,7 +1030,6 @@
1164
1030
  alert(titleAndString);
1165
1031
  okWasPressed = true;
1166
1032
  }
1167
- // return the result from the user
1168
1033
  return okWasPressed;
1169
1034
  };
1170
1035
  return confirmationBox;
@@ -1198,38 +1063,18 @@
1198
1063
  i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
1199
1064
  }
1200
1065
  }
1201
- /**
1202
- * Creates a modal window for Magic modal window components
1203
- */
1204
1066
  var MagicOverlayContainer = /** @class */ (function (_super) {
1205
1067
  __extends(MagicOverlayContainer, _super);
1206
- /**
1207
- *
1208
- * @param injector
1209
- * @param componentFactoryResolver
1210
- */
1211
1068
  function MagicOverlayContainer(injector, componentFactoryResolver) {
1212
1069
  var _this = _super.call(this) || this;
1213
1070
  _this.injector = injector;
1214
1071
  _this.componentFactoryResolver = componentFactoryResolver;
1215
- /**
1216
- *
1217
- */
1218
1072
  _this.ModalComp = null;
1219
- /**
1220
- *
1221
- */
1222
1073
  _this.ModalCompParameters = {};
1223
1074
  _this.onClose = new i0.EventEmitter();
1224
- /**
1225
- *
1226
- */
1227
1075
  _this.componentRef = null;
1228
1076
  return _this;
1229
1077
  }
1230
- /**
1231
- *
1232
- */
1233
1078
  MagicOverlayContainer.prototype.ngOnInit = function () {
1234
1079
  var factory = this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);
1235
1080
  this.componentRef = this.modalbodyViewContainerRef.createComponent(factory);
@@ -1238,10 +1083,6 @@
1238
1083
  MagicOverlayContainer.prototype.setViewContainerRef = function (vcRef) {
1239
1084
  this.modalbodyViewContainerRef = vcRef;
1240
1085
  };
1241
- /**
1242
- * Returns the form name
1243
- * @returns
1244
- */
1245
1086
  MagicOverlayContainer.prototype.getText = function () {
1246
1087
  if (this.componentRef !== null) {
1247
1088
  var comp = this.componentRef.instance;
@@ -1250,10 +1091,6 @@
1250
1091
  else
1251
1092
  return "";
1252
1093
  };
1253
- /**
1254
- * Returns CSS styles for the window
1255
- * @returns
1256
- */
1257
1094
  MagicOverlayContainer.prototype.getStyle = function () {
1258
1095
  var styles = {};
1259
1096
  if (this.componentRef != undefined) {
@@ -1270,10 +1107,6 @@
1270
1107
  }
1271
1108
  return styles;
1272
1109
  };
1273
- /**
1274
- * Returns the CSS styles for the client area
1275
- * @returns
1276
- */
1277
1110
  MagicOverlayContainer.prototype.getClientAreaStyles = function () {
1278
1111
  var styles = {};
1279
1112
  if (this.componentRef != undefined) {
@@ -1289,25 +1122,15 @@
1289
1122
  }
1290
1123
  return styles;
1291
1124
  };
1292
- /**
1293
- * Should the title bar be displayed
1294
- * @returns
1295
- */
1296
1125
  MagicOverlayContainer.prototype.getShowTitleBar = function () {
1297
1126
  if (this.componentRef != undefined) {
1298
1127
  var comp = this.componentRef.instance;
1299
1128
  return comp.ShowTitleBar();
1300
1129
  }
1301
1130
  };
1302
- /**
1303
- *
1304
- */
1305
1131
  MagicOverlayContainer.prototype.OnClose = function () {
1306
1132
  this.onClose.emit();
1307
1133
  };
1308
- /**
1309
- * Handles click in the background window
1310
- */
1311
1134
  MagicOverlayContainer.prototype.OnBackgroundClick = function () {
1312
1135
  var comp = this.componentRef.instance;
1313
1136
  if (comp.ShouldCloseOnBackgroundClick())
@@ -1315,8 +1138,8 @@
1315
1138
  };
1316
1139
  return MagicOverlayContainer;
1317
1140
  }(exports.BaseMagicOverlayContainer));
1318
- /** @nocollapse */ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
1319
- /** @nocollapse */ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
1141
+ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
1142
+ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
1320
1143
  if (rf & 1) {
1321
1144
  i0.ɵɵviewQuery(_c0$1, true);
1322
1145
  i0.ɵɵviewQuery(_c1, true);
@@ -1352,7 +1175,7 @@
1352
1175
  i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
1353
1176
  }
1354
1177
  }, directives: [i1.NgIf, i1.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}"] });
1355
- /*@__PURE__*/ (function () {
1178
+ (function () {
1356
1179
  i0.ɵsetClassMetadata(MagicOverlayContainer, [{
1357
1180
  type: i0.Component,
1358
1181
  args: [{
@@ -1375,10 +1198,6 @@
1375
1198
  }] });
1376
1199
  })();
1377
1200
 
1378
- /**
1379
- * Service managing overlay windows
1380
- * This is Magic's default provider
1381
- */
1382
1201
  var OverlayContainerMagicProvider = /** @class */ (function () {
1383
1202
  function OverlayContainerMagicProvider() {
1384
1203
  }
@@ -1387,17 +1206,14 @@
1387
1206
  };
1388
1207
  return OverlayContainerMagicProvider;
1389
1208
  }());
1390
- /** @nocollapse */ OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
1391
- /** @nocollapse */ OverlayContainerMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
1392
- /*@__PURE__*/ (function () {
1209
+ OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
1210
+ OverlayContainerMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
1211
+ (function () {
1393
1212
  i0.ɵsetClassMetadata(OverlayContainerMagicProvider, [{
1394
1213
  type: i0.Injectable
1395
1214
  }], null, null);
1396
1215
  })();
1397
1216
 
1398
- /***
1399
- * This is sample component for the alert message
1400
- */
1401
1217
  var MagicAlertComponent = /** @class */ (function (_super) {
1402
1218
  __extends(MagicAlertComponent, _super);
1403
1219
  function MagicAlertComponent() {
@@ -1405,8 +1221,8 @@
1405
1221
  }
1406
1222
  return MagicAlertComponent;
1407
1223
  }(BaseMagicAlertComponent));
1408
- /** @nocollapse */ MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
1409
- /** @nocollapse */ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) {
1224
+ MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
1225
+ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) {
1410
1226
  if (rf & 1) {
1411
1227
  i0.ɵɵelementStart(0, "div");
1412
1228
  i0.ɵɵelementStart(1, "div", 0);
@@ -1430,8 +1246,8 @@
1430
1246
  i0.ɵɵtextInterpolate1("", ctx.message, " ");
1431
1247
  }
1432
1248
  }, 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 }"] });
1433
- var ɵMagicAlertComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MagicAlertComponent);
1434
- /*@__PURE__*/ (function () {
1249
+ var ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent);
1250
+ (function () {
1435
1251
  i0.ɵsetClassMetadata(MagicAlertComponent, [{
1436
1252
  type: i0.Component,
1437
1253
  args: [{
@@ -1442,9 +1258,6 @@
1442
1258
  }], null, null);
1443
1259
  })();
1444
1260
 
1445
- /***
1446
- * This is sample component for the confirmation box
1447
- */
1448
1261
  var MagicConfirmationBoxComponent = /** @class */ (function (_super) {
1449
1262
  __extends(MagicConfirmationBoxComponent, _super);
1450
1263
  function MagicConfirmationBoxComponent() {
@@ -1452,8 +1265,8 @@
1452
1265
  }
1453
1266
  return MagicConfirmationBoxComponent;
1454
1267
  }(BaseMagicConfirmComponent));
1455
- /** @nocollapse */ MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
1456
- /** @nocollapse */ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) {
1268
+ MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
1269
+ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) {
1457
1270
  if (rf & 1) {
1458
1271
  i0.ɵɵelementStart(0, "div");
1459
1272
  i0.ɵɵelementStart(1, "div", 0);
@@ -1481,8 +1294,8 @@
1481
1294
  i0.ɵɵtextInterpolate1(" ", ctx.message, " ");
1482
1295
  }
1483
1296
  }, 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 }"] });
1484
- var ɵMagicConfirmationBoxComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
1485
- /*@__PURE__*/ (function () {
1297
+ var ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
1298
+ (function () {
1486
1299
  i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
1487
1300
  type: i0.Component,
1488
1301
  args: [{
@@ -1493,51 +1306,28 @@
1493
1306
  }], null, null);
1494
1307
  })();
1495
1308
 
1496
- /**
1497
- * Service managing overlay windows
1498
- * This is Magic's default provider
1499
- */
1500
- /**
1501
- * Service managing alert and confirmation windows
1502
- * This is Magic's default provider
1503
- */
1504
1309
  var ConfirmationComponentsMagicProvider = /** @class */ (function () {
1505
1310
  function ConfirmationComponentsMagicProvider() {
1506
1311
  }
1507
- /**
1508
- * Return true when use default javascript alert and confirmation or return false to provide custom components
1509
- * @returns true is we want to use default javascript alert and confirmation
1510
- */
1511
1312
  ConfirmationComponentsMagicProvider.prototype.showDefaultConfirmations = function () {
1512
1313
  return true;
1513
1314
  };
1514
- /**
1515
- * Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
1516
- * @returns component that will replace javascript Alert
1517
- */
1518
1315
  ConfirmationComponentsMagicProvider.prototype.getAlertComponent = function () {
1519
1316
  return MagicAlertComponent;
1520
1317
  };
1521
- /**
1522
- * Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
1523
- * @returns component that will replace javascript confirmation box
1524
- */
1525
1318
  ConfirmationComponentsMagicProvider.prototype.getConfirmtionComponent = function () {
1526
1319
  return MagicConfirmationBoxComponent;
1527
1320
  };
1528
1321
  return ConfirmationComponentsMagicProvider;
1529
1322
  }());
1530
- /** @nocollapse */ ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
1531
- /** @nocollapse */ ConfirmationComponentsMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
1532
- /*@__PURE__*/ (function () {
1323
+ ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
1324
+ ConfirmationComponentsMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
1325
+ (function () {
1533
1326
  i0.ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
1534
1327
  type: i0.Injectable
1535
1328
  }], null, null);
1536
1329
  })();
1537
1330
 
1538
- /**
1539
- * Service managing overlay windows
1540
- */
1541
1331
  var OverlayWindowService = /** @class */ (function () {
1542
1332
  function OverlayWindowService(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1543
1333
  this.componentFactoryResolver = componentFactoryResolver;
@@ -1553,7 +1343,6 @@
1553
1343
  };
1554
1344
  OverlayWindowService.prototype.open = function (formName, taskId, taskDescription) {
1555
1345
  var _this = this;
1556
- // for overlay which are lazy loaded don't find data in component-list
1557
1346
  var comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
1558
1347
  var parameters = { taskIdParam: taskId, taskDescription: taskDescription };
1559
1348
  var componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), gui.OverlayType.Overlay);
@@ -1564,28 +1353,19 @@
1564
1353
  });
1565
1354
  };
1566
1355
  OverlayWindowService.prototype.close = function (commandStr) {
1567
- // Close the overlay by removing the overlay window from its container
1568
1356
  this.overlayWindowsContainerViewRef.remove();
1569
1357
  this.overlayWindowFocusManager.popDialog();
1570
1358
  var guiEvent1 = engine.getGuiEventObj("dispose", null, 0);
1571
1359
  guiEvent1.TaskID = commandStr;
1572
1360
  this.engineMagicService.insertEvent(guiEvent1);
1573
1361
  };
1574
- /**
1575
- * Open Confirmation box
1576
- * @param title title of the box
1577
- * @param msg message
1578
- * @param style Magic style
1579
- */
1580
1362
  OverlayWindowService.prototype.openConfirmationBox = function (title, msg, style) {
1581
1363
  var _this = this;
1582
- //show default confirmations
1583
1364
  if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
1584
1365
  var res = confirmationBox.showConfirmationBox(title, msg, style);
1585
1366
  this.finishConfirmation(style, res);
1586
1367
  }
1587
1368
  else {
1588
- //show custom confirmations
1589
1369
  var comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
1590
1370
  var overlayType = confirmationBox.isConfirmBox(style) ? gui.OverlayType.ConfirmationBox : gui.OverlayType.Alert;
1591
1371
  var componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
@@ -1596,21 +1376,11 @@
1596
1376
  });
1597
1377
  }
1598
1378
  };
1599
- /**
1600
- * This method is called on close of the confirmation
1601
- * @param style Magic style
1602
- * @param result
1603
- */
1604
1379
  OverlayWindowService.prototype.finishConfirmation = function (style, result) {
1605
1380
  var guiEvent = engine.getGuiEventObj("confirmationClosed", null, 0);
1606
1381
  guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
1607
1382
  this.engineMagicService.insertEvent(guiEvent);
1608
1383
  };
1609
- /**
1610
- * creates a modal component. Can be used for overlay, message box or confirmation box
1611
- * @param parameters component's parameters
1612
- * @param component components to create
1613
- */
1614
1384
  OverlayWindowService.prototype.createModalComponent = function (parameters, component, overlayType) {
1615
1385
  var componentRef;
1616
1386
  var magicModalContainerParameters = {
@@ -1618,11 +1388,9 @@
1618
1388
  Parameters: parameters,
1619
1389
  OverlayTypeParam: overlayType
1620
1390
  };
1621
- // Create the UI component of modal window
1622
1391
  var factory = this.componentFactoryResolver.resolveComponentFactory(MagicOverlayContainerWrapper);
1623
1392
  var viewCRef = this.overlayWindowsContainerViewRef;
1624
1393
  componentRef = viewCRef.createComponent(factory);
1625
- // Set the data to newly created component
1626
1394
  Object.assign(componentRef.instance, magicModalContainerParameters);
1627
1395
  this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
1628
1396
  componentRef.instance.DetectChanges();
@@ -1630,9 +1398,9 @@
1630
1398
  };
1631
1399
  return OverlayWindowService;
1632
1400
  }());
1633
- /** @nocollapse */ OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
1634
- /** @nocollapse */ OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
1635
- /*@__PURE__*/ (function () {
1401
+ OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
1402
+ OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
1403
+ (function () {
1636
1404
  i0.ɵsetClassMetadata(OverlayWindowService, [{
1637
1405
  type: i0.Injectable
1638
1406
  }], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null);
@@ -1765,103 +1533,45 @@
1765
1533
  return DialogInfo;
1766
1534
  }());
1767
1535
 
1768
- /**
1769
- * Main service to connect the UI with the Magic WebCLient
1770
- */
1771
1536
  var TaskMagicService = /** @class */ (function () {
1772
- /**
1773
- *
1774
- * @param magic
1775
- */
1776
1537
  function TaskMagicService(magic, overlayWindowService) {
1777
1538
  this.magic = magic;
1778
1539
  this.overlayWindowService = overlayWindowService;
1779
- /**
1780
- * Collection of data for all controls
1781
- */
1782
1540
  this.Records = new Records();
1783
- /**
1784
- * FormGroup collection for line mode
1785
- */
1786
1541
  this.formGroups = [];
1787
- /**
1788
- * @ignore
1789
- */
1790
1542
  this.refreshDom = new rxjs.Subject();
1791
- /**
1792
- * @ignore
1793
- */
1794
1543
  this.detectChanges = new rxjs.Subject();
1795
- /**
1796
- * @ignore
1797
- */
1798
1544
  this.interactiveCommands = new rxjs.Subject();
1799
- /**
1800
- * @ignore
1801
- * This event is emitted when the selected row in a table changes.
1802
- */
1803
1545
  this.OnSelectedRowChanged = new i0.EventEmitter();
1804
- /**
1805
- * @ignore
1806
- */
1807
1546
  this.customPropertiesSubject = new rxjs.Subject();
1808
- /**
1809
- * @ignore
1810
- */
1811
1547
  this.recordsCountChangeSubject = new rxjs.Subject();
1812
- /**
1813
- * @ignore
1814
- */
1815
1548
  this.oldPageSize = 0;
1816
1549
  this.Records.setGuiTopIndex(0);
1817
1550
  this.mgInputDateFormat = null;
1818
1551
  }
1819
- /**
1820
- * returns true if used is logged in
1821
- * @returns
1822
- */
1823
1552
  TaskMagicService.prototype.getIsLoggenIn = function () {
1824
1553
  return this.magic.getIsLoggedIn();
1825
1554
  };
1826
1555
  Object.defineProperty(TaskMagicService.prototype, "taskId", {
1827
- /**
1828
- * returns the task Id
1829
- * @returns
1830
- */
1831
1556
  get: function () {
1832
1557
  return this._taskId;
1833
1558
  },
1834
- /**
1835
- * Sets the task Id
1836
- * @param value the task id to set
1837
- */
1838
1559
  set: function (value) {
1839
- // debugger;
1840
1560
  this._taskId = value;
1841
1561
  },
1842
1562
  enumerable: false,
1843
1563
  configurable: true
1844
1564
  });
1845
1565
  Object.defineProperty(TaskMagicService.prototype, "ScreenControlsData", {
1846
- /**
1847
- * Returns the task's data in Screen mode
1848
- * @returns
1849
- */
1850
1566
  get: function () {
1851
1567
  return this.Records.list['0'];
1852
1568
  },
1853
1569
  enumerable: false,
1854
1570
  configurable: true
1855
1571
  });
1856
- /**
1857
- * @ignore
1858
- */
1859
1572
  TaskMagicService.prototype.settemplate = function (value) {
1860
1573
  this.template = value;
1861
1574
  };
1862
- /**
1863
- * Builds the FormControl for each and every control
1864
- */
1865
1575
  TaskMagicService.prototype.buildScreenModeControls = function () {
1866
1576
  var group = new forms.FormGroup({});
1867
1577
  for (var key in this.template) {
@@ -1873,21 +1583,10 @@
1873
1583
  }
1874
1584
  this.ScreenModeControls = group;
1875
1585
  };
1876
- /**
1877
- * Is the control a table control
1878
- * @param id Id of the control
1879
- * @returns
1880
- */
1881
1586
  TaskMagicService.prototype.isTableControl = function (id) {
1882
1587
  return this.template[id] == '1';
1883
1588
  };
1884
1589
  TaskMagicService.prototype.getMgInputDateFormat = function () { return this.mgInputDateFormat; };
1885
- /**
1886
- * Returns the FormControl of a control
1887
- * @param guiRowid Id of the requested row
1888
- * @param id Id of the control
1889
- * @returns
1890
- */
1891
1590
  TaskMagicService.prototype.getFormControl = function (guiRowid, id) {
1892
1591
  var c;
1893
1592
  var group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
@@ -1897,21 +1596,12 @@
1897
1596
  }
1898
1597
  return c;
1899
1598
  };
1900
- /**
1901
- * handle the change of text for input control inside table
1902
- * @param guiRowId Id of the row for which the FormControls are built
1903
- * set the new value of the formcontrol
1904
- */
1905
1599
  TaskMagicService.prototype.setInputTextValue = function (controlId, guiRowid, val) {
1906
1600
  this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
1907
1601
  var fc = this.getFormControl(guiRowid, controlId);
1908
1602
  if (!util.isNullOrUndefined(val))
1909
1603
  fc.setValue(val);
1910
1604
  };
1911
- /**
1912
- * Build the FormControls for a table row
1913
- * @param guiRowId Id of the row for which the FormControls are built
1914
- */
1915
1605
  TaskMagicService.prototype.buildTableRowControls = function (guiRowId) {
1916
1606
  var group = new forms.FormGroup({});
1917
1607
  for (var key in this.template) {
@@ -1923,58 +1613,30 @@
1923
1613
  }
1924
1614
  this.formGroups[guiRowId] = group;
1925
1615
  };
1926
- /**
1927
- *
1928
- * @ignore
1929
- */
1930
1616
  TaskMagicService.prototype.updateRecordsBeforeCurrentView = function (value) {
1931
1617
  this.Records.recordsBeforeCurrentView = value;
1932
1618
  };
1933
- /**
1934
- * @ignore
1935
- */
1936
1619
  TaskMagicService.prototype.setIncludesFirst = function (value) {
1937
1620
  this.Records.includesFirst = value;
1938
1621
  };
1939
- /**
1940
- * @ignore
1941
- */
1942
1622
  TaskMagicService.prototype.setIncludesLast = function (value) {
1943
1623
  this.Records.includesLast = value;
1944
1624
  };
1945
- /**
1946
- * @ignore
1947
- */
1948
1625
  TaskMagicService.prototype.markRowAsCreated = function (guiRowId) {
1949
1626
  this.Records.markRowAsCreated(guiRowId);
1950
1627
  };
1951
- /**
1952
- * @ignore
1953
- */
1954
1628
  TaskMagicService.prototype.markRowAsNotCreated = function (guiRowId) {
1955
1629
  this.Records.markRowAsNotCreated(guiRowId);
1956
1630
  };
1957
- /**
1958
- * @ignore
1959
- */
1960
1631
  TaskMagicService.prototype.startRowEditing = function (guiRowId) {
1961
1632
  this.Records.startRowEditing(guiRowId);
1962
1633
  };
1963
- /**
1964
- * @ignore
1965
- */
1966
1634
  TaskMagicService.prototype.stopRowEditing = function (guiRowId) {
1967
1635
  this.Records.stopRowEditing(guiRowId);
1968
1636
  };
1969
- /**
1970
- * @ignore
1971
- */
1972
1637
  TaskMagicService.prototype.isRowInRowEditing = function (guiRowId) {
1973
1638
  return this.Records.isRowInRowEditing(guiRowId);
1974
1639
  };
1975
- /**
1976
- * @ignore
1977
- */
1978
1640
  TaskMagicService.prototype.setIsEmptyDataView = function (isEmpty) {
1979
1641
  if (this.Records.isEmptyDataView !== isEmpty) {
1980
1642
  if (isEmpty)
@@ -1984,11 +1646,6 @@
1984
1646
  this.refreshView();
1985
1647
  }
1986
1648
  };
1987
- /**
1988
- * Initialize the service to work with the task
1989
- * @param taskId Id of the task
1990
- * @param taskDescription
1991
- */
1992
1649
  TaskMagicService.prototype.initTask = function (taskId, taskDescription) {
1993
1650
  var _this = this;
1994
1651
  this.Records.createFirst();
@@ -2001,71 +1658,39 @@
2001
1658
  this.settemplate(taskDescription);
2002
1659
  }
2003
1660
  this.buildScreenModeControls();
2004
- // remove previous subscriptions
2005
1661
  if (!util.isNullOrUndefined(this.subscribeRefreshDom))
2006
1662
  this.subscribeRefreshDom.unsubscribe();
2007
1663
  if (!util.isNullOrUndefined(this.subscribeInteractiveCommands))
2008
1664
  this.subscribeInteractiveCommands.unsubscribe();
2009
1665
  this.subscribeRefreshDom = this.magic.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
2010
1666
  .subscribe(function (command) {
2011
- // console.log("Task " + command.TaskTag + "command " + command.CommandType);
2012
1667
  _this.executeCommand(command);
2013
1668
  });
2014
1669
  this.subscribeInteractiveCommands = this.magic.interactiveCommands
2015
1670
  .pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
2016
1671
  .subscribe(function (command) {
2017
- // console.log("Task " + command.TaskTag + "command " + command.CommandType);
2018
1672
  _this.executeInteractiveCommand(command);
2019
1673
  });
2020
1674
  };
2021
- /**
2022
- * @ignore
2023
- */
2024
1675
  TaskMagicService.prototype.refreshView = function () {
2025
1676
  this.detectChanges.next('');
2026
1677
  };
2027
- /**
2028
- * Insert an event to the Magic WebClient event queue
2029
- * @param guiEvent The event to insert
2030
- */
2031
1678
  TaskMagicService.prototype.insertEvent = function (guiEvent) {
2032
1679
  guiEvent.TaskID = this.taskId;
2033
1680
  this.magic.insertEvent(guiEvent);
2034
1681
  };
2035
- /**
2036
- * @ignore
2037
- */
2038
1682
  TaskMagicService.prototype.GetControlPictureMask = function (controlName) {
2039
1683
  return this.magic.GetControlPictureMask(this.taskId, controlName);
2040
1684
  };
2041
- /**
2042
- * Validates the control value, using the Magic WebClient
2043
- * @param controlName Id of validated control
2044
- * @param value value to be validated
2045
- * @returns If validation fails, returns error message, else returns null
2046
- */
2047
1685
  TaskMagicService.prototype.ValidateControlValue = function (controlName, value) {
2048
1686
  return this.magic.ValidateControlValue(this.taskId, controlName, value);
2049
1687
  };
2050
- /**
2051
- * @ignore
2052
- */
2053
1688
  TaskMagicService.prototype.GetRangedValue = function (controlName, value) {
2054
1689
  return this.magic.GetRangedValue(this.taskId, controlName, value);
2055
1690
  };
2056
- /**
2057
- * @ignore
2058
- */
2059
1691
  TaskMagicService.prototype.GetFldRanges = function (controlName) {
2060
1692
  return this.magic.GetFldRanges(this.taskId, controlName);
2061
1693
  };
2062
- /**
2063
- * returns the value of a property of the control
2064
- * @param controlId Id of control
2065
- * @param prop Property
2066
- * @param guiRowId Row Id, if applicable
2067
- * @returns Property value
2068
- */
2069
1694
  TaskMagicService.prototype.getProperty = function (controlId, prop, guiRowId) {
2070
1695
  if (util.isNullOrUndefined(guiRowId))
2071
1696
  guiRowId = '0';
@@ -2079,9 +1704,6 @@
2079
1704
  return this.Records.list[guiRowId].getProperty(controlId, prop);
2080
1705
  }
2081
1706
  };
2082
- /**
2083
- * @ignore
2084
- */
2085
1707
  TaskMagicService.prototype.getPropertyStub = function (ControlsProperties, controlId, prop) {
2086
1708
  ControlsProperties = ControlsProperties.ControlsProperties;
2087
1709
  if (controlId in ControlsProperties) {
@@ -2091,31 +1713,15 @@
2091
1713
  }
2092
1714
  return '';
2093
1715
  };
2094
- /**
2095
- * @ignore
2096
- */
2097
1716
  TaskMagicService.prototype.getStyleStub = function (ControlsProperties, controlId, styleName) {
2098
1717
  ControlsProperties = ControlsProperties.ControlsProperties;
2099
1718
  return ControlsProperties[controlId].stylesMap.get(styleName);
2100
1719
  };
2101
- /**
2102
- * Return the CSS classes used for this control
2103
- * @param controlId Id of control
2104
- * @param guiRowId Row Id, if applicable
2105
- * @returns String containing the classes currently defined for this control
2106
- */
2107
1720
  TaskMagicService.prototype.getClasses = function (controlId, guiRowId) {
2108
1721
  if (util.isNullOrUndefined(guiRowId))
2109
1722
  guiRowId = '0';
2110
1723
  return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
2111
1724
  };
2112
- /**
2113
- * Return the value of a style used for a control
2114
- * @param controlId Id of control
2115
- * @param styleName Name of style
2116
- * @param guiRowId Row Id, if applicable
2117
- * @returns value of style of the control
2118
- */
2119
1725
  TaskMagicService.prototype.getStyle = function (controlId, styleName, guiRowId) {
2120
1726
  if (util.isNullOrUndefined(guiRowId))
2121
1727
  guiRowId = '0';
@@ -2126,36 +1732,21 @@
2126
1732
  return StylesMapManager.magicValueGetStyle(styleName, magicValue);
2127
1733
  }
2128
1734
  };
2129
- /**
2130
- * Return the value of a control
2131
- * @param controlId Id of control
2132
- * @param guiRowId Row Id, if applicable
2133
- * @returns value of the control
2134
- */
2135
1735
  TaskMagicService.prototype.getValue = function (controlId, guiRowId) {
2136
1736
  if (util.isNullOrUndefined(guiRowId))
2137
1737
  guiRowId = '0';
2138
1738
  return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
2139
1739
  };
2140
- /**
2141
- * Sets the value of a control
2142
- * @param controlId Id of control
2143
- * @param guiRowId Row Id, if applicable
2144
- * @param value Value to set
2145
- */
1740
+ TaskMagicService.prototype.getFormattedValue = function (controlName, val) {
1741
+ return this.magic.GetFormattedValue(this.taskId, controlName, val);
1742
+ };
2146
1743
  TaskMagicService.prototype.setValue = function (controlId, guiRowId, value) {
2147
1744
  return this.Records.list[guiRowId].setValue(controlId, value);
2148
1745
  };
2149
- /**
2150
- * @ignore
2151
- */
2152
1746
  TaskMagicService.prototype.executeInteractiveCommand = function (guiInteractiveCommand) {
2153
1747
  GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
2154
1748
  this.interactiveCommands.next(guiInteractiveCommand);
2155
1749
  };
2156
- /**
2157
- * @ignore
2158
- */
2159
1750
  TaskMagicService.prototype.handleSetProperty = function (command, isTableChild) {
2160
1751
  var controlId = command.CtrlName;
2161
1752
  var dvRowId = (command.line || 0);
@@ -2192,7 +1783,6 @@
2192
1783
  var controlId = command.CtrlName;
2193
1784
  var properties;
2194
1785
  var isTableChild = this.isTableControl(controlId);
2195
- // For non-input type controls on table.
2196
1786
  if (command.obj !== null)
2197
1787
  isTableChild = isTableChild || command.obj.IsTableChild;
2198
1788
  guiRowId = this.getGuiRowId(dvRowId, isTableChild);
@@ -2243,13 +1833,13 @@
2243
1833
  break;
2244
1834
  case gui.CommandType.SET_PROPERTY:
2245
1835
  this.handleSetProperty(command, isTableChild);
1836
+ if (command.Operation == gui.HtmlProperties.ReadOnly)
1837
+ this.refreshDom.next(command);
2246
1838
  break;
2247
1839
  case gui.CommandType.PROP_SET_USER_PROPERTY:
2248
1840
  properties = this.Records.list[guiRowId].getControlMetadata(controlId);
2249
- // if the property has changed, set the property and raise the subject
2250
1841
  if (properties.userProperties.get(command.Operation) !== command.obj1) {
2251
1842
  properties.userProperties.set(command.Operation, command.obj1);
2252
- // the property name is of format <controlName>~<propertyName>
2253
1843
  this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
2254
1844
  }
2255
1845
  break;
@@ -2294,12 +1884,11 @@
2294
1884
  case gui.CommandType.SET_EMPTY_DATAVIEW:
2295
1885
  this.setIsEmptyDataView(command.Bool1);
2296
1886
  break;
1887
+ case gui.CommandType.SET_FOCUS:
1888
+ this.refreshDom.next(command);
1889
+ break;
2297
1890
  }
2298
- this.refreshDom.next(command);
2299
1891
  };
2300
- /**
2301
- custom validator
2302
- */
2303
1892
  TaskMagicService.prototype.customValidator = function (rowid, id) {
2304
1893
  var _this = this;
2305
1894
  return function (control) {
@@ -2325,13 +1914,6 @@
2325
1914
  return null;
2326
1915
  };
2327
1916
  };
2328
- /**
2329
- * COnvert a value from Magic format to native format
2330
- * @param controlId Id of control
2331
- * @param rowId Row Id, if applicable
2332
- * @param val Value to convert
2333
- * @returns Converted value
2334
- */
2335
1917
  TaskMagicService.prototype.ConvertValToNative = function (controlId, rowId, val) {
2336
1918
  var properties;
2337
1919
  properties = this.Records.list[0].getControlMetadata(controlId);
@@ -2380,13 +1962,6 @@
2380
1962
  return val;
2381
1963
  }
2382
1964
  };
2383
- /**
2384
- * Convert a value from native to Magic format
2385
- * @param controlId Id of control
2386
- * @param rowId Row Id, if applicable
2387
- * @param val Value to convert
2388
- * @returns Converted value
2389
- */
2390
1965
  TaskMagicService.prototype.ConvertValFromNative = function (controlId, rowId, val) {
2391
1966
  var properties;
2392
1967
  properties = this.Records.list[0].getControlMetadata(controlId);
@@ -2429,22 +2004,12 @@
2429
2004
  return val;
2430
2005
  }
2431
2006
  };
2432
- /**
2433
- * Handle resize and also fetch chunk of records if having an empty view.
2434
- * @ignore
2435
- * @param pageSize : PageSize
2436
- * @param topGuiRowId : GuiRowId of first record in view.
2437
- */
2438
2007
  TaskMagicService.prototype.resize = function (pageSize, topGuiRowId) {
2439
2008
  var guiEvent = engine.getGuiEventObj('resize', 'table', 0);
2440
2009
  guiEvent.PageSize = pageSize;
2441
- //As 'getRows' event also gets executed, set the guiEvent.Line parameter.
2442
2010
  guiEvent.Line = topGuiRowId;
2443
2011
  this.insertEvent(guiEvent);
2444
2012
  };
2445
- /**
2446
- * Fetches data for new table rows when scrolling done
2447
- */
2448
2013
  TaskMagicService.prototype.onScrollDown = function () {
2449
2014
  if (!this.Records.includesLast) {
2450
2015
  var guiEvent = engine.getGuiEventObj('getRows', 'table', 0);
@@ -2452,29 +2017,15 @@
2452
2017
  this.insertEvent(guiEvent);
2453
2018
  }
2454
2019
  };
2455
- /**
2456
- * Sets the new browser window title
2457
- * @param newTitle New window title
2458
- */
2459
2020
  TaskMagicService.prototype.setTitle = function (newTitle) {
2460
2021
  this.mgTitleService.setTitle(newTitle);
2461
2022
  };
2462
- /**
2463
- * @ignore
2464
- */
2465
2023
  TaskMagicService.prototype.getGuiRowId = function (dvRowId, isTableControl) {
2466
2024
  return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
2467
2025
  };
2468
- /**
2469
- *
2470
- * @ignore
2471
- */
2472
2026
  TaskMagicService.prototype.getDvRowId = function (guiRowId) {
2473
2027
  return (guiRowId - this.Records.recordsBeforeCurrentView);
2474
2028
  };
2475
- /**
2476
- * Clean up the service when it is no longer needed
2477
- */
2478
2029
  TaskMagicService.prototype.dispose = function () {
2479
2030
  this.refreshDom.complete();
2480
2031
  this.detectChanges.complete();
@@ -2484,14 +2035,6 @@
2484
2035
  this.customPropertiesSubject.complete();
2485
2036
  this.OnSelectedRowChanged.complete();
2486
2037
  };
2487
- ///////////////////////////////
2488
- //Events:
2489
- /**
2490
- * Handle the Combobox "change" event
2491
- * @param event The event received from the UI
2492
- * @param idx Id of the control raising the event
2493
- * @param line Row Id, if applicable
2494
- */
2495
2038
  TaskMagicService.prototype.onComboboxSelectionChanged = function (event, idx, line) {
2496
2039
  var guiEvent = engine.getGuiEventObj('selectionchanged', idx, line);
2497
2040
  if (typeof (event) == 'number') {
@@ -2510,11 +2053,6 @@
2510
2053
  }
2511
2054
  this.insertEvent(guiEvent);
2512
2055
  };
2513
- /**
2514
- * Handle the Listbox "change" event
2515
- * @param event The event received from the UI
2516
- * @param idx Id of the control raising the event
2517
- */
2518
2056
  TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
2519
2057
  var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2520
2058
  var selectedOptions;
@@ -2530,15 +2068,9 @@
2530
2068
  else
2531
2069
  indexes[i] = (selectedOptions[i]).value;
2532
2070
  }
2533
- guiEvent.Value = indexes; // TODO: fix
2071
+ guiEvent.Value = indexes;
2534
2072
  this.insertEvent(guiEvent);
2535
2073
  };
2536
- /**
2537
- * Handle the Checkbox "change" event
2538
- * @param event The event received from the UI
2539
- * @param idx Id of the control raising the event
2540
- * @param rowId Row Id, if applicable
2541
- */
2542
2074
  TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
2543
2075
  if (typeof rowId === 'undefined')
2544
2076
  rowId = 0;
@@ -2554,21 +2086,11 @@
2554
2086
  }
2555
2087
  this.insertEvent(guiEvent);
2556
2088
  };
2557
- /**
2558
- * Handle tab selection change, caused by UI events
2559
- * @param idx Id of the control raising the event
2560
- * @param layer Id of selected tabpage
2561
- */
2562
2089
  TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
2563
2090
  var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
2564
2091
  guiEvent.Value = layer.toString();
2565
2092
  this.insertEvent(guiEvent);
2566
2093
  };
2567
- /**
2568
- * Handle the Radio button "change" event
2569
- * @param event The event received from the UI
2570
- * @param idx Id of the control raising the event
2571
- */
2572
2094
  TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
2573
2095
  var result = this.getFormControl('0', idx);
2574
2096
  var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
@@ -2578,28 +2100,15 @@
2578
2100
  guiEvent.Value = result.value;
2579
2101
  this.insertEvent(guiEvent);
2580
2102
  };
2581
- /**
2582
- * Inserts the "close" event to the magic WebClient event queue
2583
- */
2584
2103
  TaskMagicService.prototype.close = function () {
2585
2104
  this.insertEvent(engine.getGuiEventObj('close', null, 0));
2586
2105
  };
2587
- ///////////////////////////////
2588
- /**
2589
- * @ignore
2590
- */
2591
2106
  TaskMagicService.prototype.IsStub = function () {
2592
2107
  return this.magic.isStub;
2593
2108
  };
2594
- /**
2595
- * @ignore
2596
- */
2597
2109
  TaskMagicService.prototype.saveData = function (data) {
2598
2110
  this.magic.saveData(data);
2599
2111
  };
2600
- /**
2601
- * @ignore
2602
- */
2603
2112
  TaskMagicService.prototype.createData = function () {
2604
2113
  var myData = {
2605
2114
  records: this.Records,
@@ -2611,9 +2120,6 @@
2611
2120
  console.log(text);
2612
2121
  this.saveData(text);
2613
2122
  };
2614
- /**
2615
- * @ignore
2616
- */
2617
2123
  TaskMagicService.prototype.loadStubData = function (stubData) {
2618
2124
  this.Records = stubData.records;
2619
2125
  this.settemplate(stubData.template);
@@ -2621,15 +2127,9 @@
2621
2127
  for (var i = 0; i < this.Records.list.length; i++)
2622
2128
  this.buildTableRowControls(i);
2623
2129
  };
2624
- /**
2625
- * @ignore
2626
- */
2627
2130
  TaskMagicService.prototype.loadData = function () {
2628
2131
  alert('Please, overwrite method loadData');
2629
2132
  };
2630
- /**
2631
- * @ignore
2632
- */
2633
2133
  TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
2634
2134
  if (this.IsStub()) {
2635
2135
  try {
@@ -2642,17 +2142,14 @@
2642
2142
  };
2643
2143
  return TaskMagicService;
2644
2144
  }());
2645
- /** @nocollapse */ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
2646
- /** @nocollapse */ TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
2647
- /*@__PURE__*/ (function () {
2145
+ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
2146
+ TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
2147
+ (function () {
2648
2148
  i0.ɵsetClassMetadata(TaskMagicService, [{
2649
2149
  type: i0.Injectable
2650
2150
  }], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
2651
2151
  })();
2652
2152
 
2653
- /**
2654
- * @ignore
2655
- */
2656
2153
  var CommandsCollectorMagicService = /** @class */ (function () {
2657
2154
  function CommandsCollectorMagicService(magic) {
2658
2155
  this.magic = magic;
@@ -2687,25 +2184,19 @@
2687
2184
  };
2688
2185
  return CommandsCollectorMagicService;
2689
2186
  }());
2690
- /** @nocollapse */ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
2691
- /** @nocollapse */ CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
2692
- /*@__PURE__*/ (function () {
2187
+ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
2188
+ CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
2189
+ (function () {
2693
2190
  i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
2694
2191
  type: i0.Injectable
2695
2192
  }], function () { return [{ type: EngineMagicService }]; }, null);
2696
2193
  })();
2697
2194
 
2698
- /**
2699
- * @ignore
2700
- */
2701
2195
  var RouteCommand = /** @class */ (function () {
2702
2196
  function RouteCommand() {
2703
2197
  }
2704
2198
  return RouteCommand;
2705
2199
  }());
2706
- /**
2707
- * @ignore
2708
- */
2709
2200
  var RouterCommandsMagicService = /** @class */ (function () {
2710
2201
  function RouterCommandsMagicService() {
2711
2202
  this.pendingRouteCommands = [];
@@ -2721,34 +2212,29 @@
2721
2212
  };
2722
2213
  return RouterCommandsMagicService;
2723
2214
  }());
2724
- /** @nocollapse */ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
2725
- /** @nocollapse */ RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
2726
- /*@__PURE__*/ (function () {
2215
+ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
2216
+ RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
2217
+ (function () {
2727
2218
  i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
2728
2219
  type: i0.Injectable
2729
2220
  }], null, null);
2730
2221
  })();
2731
2222
 
2732
- /**
2733
- * Service for managing subforms and routing
2734
- */
2735
2223
  var SubformMagicService = /** @class */ (function () {
2736
- function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
2224
+ function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector) {
2737
2225
  this.task = task;
2738
2226
  this.activatedRoute = activatedRoute;
2739
2227
  this.componentList = componentList;
2740
2228
  this.pendingCommandsCollector = pendingCommandsCollector;
2741
2229
  this.router = router;
2742
2230
  this.routerCommandsMagicService = routerCommandsMagicService;
2743
- this.subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
2744
- this.routesDict = {}; // dictionary of router outlet to router path
2231
+ this.componentListMagicService = componentListMagicService;
2232
+ this.loader = loader;
2233
+ this.injector = injector;
2234
+ this.subformsDict = {};
2235
+ this.routesDict = {};
2745
2236
  this.currentRouteDefinition = null;
2746
2237
  }
2747
- /**
2748
- * Finds and returns the component according to the subform name
2749
- * @param subformName
2750
- * @returns
2751
- */
2752
2238
  SubformMagicService.prototype.mgGetComp = function (subformName) {
2753
2239
  if (subformName in this.subformsDict) {
2754
2240
  var formName = this.subformsDict[subformName].formName;
@@ -2757,11 +2243,6 @@
2757
2243
  }
2758
2244
  return null;
2759
2245
  };
2760
- /**
2761
- * Returns the parameters of the subform
2762
- * @param subformName
2763
- * @returns
2764
- */
2765
2246
  SubformMagicService.prototype.mgGetParameters = function (subformName) {
2766
2247
  if (subformName in this.subformsDict) {
2767
2248
  return this.subformsDict[subformName].parameters;
@@ -2769,9 +2250,6 @@
2769
2250
  else
2770
2251
  return "";
2771
2252
  };
2772
- /**
2773
- * @ignore
2774
- */
2775
2253
  SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
2776
2254
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2777
2255
  if (this.subformsDict[subformControlName].formName === formName) {
@@ -2780,27 +2258,35 @@
2780
2258
  }
2781
2259
  }
2782
2260
  };
2783
- /**
2784
- * @ignore
2785
- */
2786
2261
  SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
2262
+ var _this = this;
2787
2263
  this.pendingCommandsCollector.startCollecting();
2788
2264
  var refreshNeeded = false;
2789
- if (util.isNullOrUndefined(routerPath)) { // call in destination subform
2265
+ if (util.isNullOrUndefined(routerPath)) {
2790
2266
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
2791
2267
  if (this.subformsDict[subformControlName].formName === formName) {
2792
2268
  this.subformsDict[subformControlName] = {};
2793
2269
  this.task.refreshView();
2794
2270
  }
2795
2271
  }
2272
+ var moduleRef_1 = this.componentListMagicService.getModuleRef(formName);
2273
+ if (moduleRef_1 == null) {
2274
+ var lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
2275
+ if (lazyLoadModule != null) {
2276
+ this.loader
2277
+ .load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
2278
+ .then(function (moduleFactory) {
2279
+ moduleRef_1 = moduleFactory.create(_this.injector);
2280
+ });
2281
+ }
2282
+ }
2796
2283
  this.subformsDict[subformControlName] = {
2797
2284
  formName: formName,
2798
2285
  parameters: { taskIdParam: taskId, taskDescription: taskDescription }
2799
2286
  };
2800
- //this.ref.detectChanges();
2801
2287
  refreshNeeded = true;
2802
2288
  }
2803
- else { // call route
2289
+ else {
2804
2290
  if (inDefaultOutlet)
2805
2291
  subformControlName = "primary";
2806
2292
  var routeParams = new mscorelib.List();
@@ -2815,10 +2301,6 @@
2815
2301
  parameters: { taskIdParam: taskId, taskDescription: taskDescription },
2816
2302
  routeParams: routeParams
2817
2303
  };
2818
- // If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
2819
- // called once, but angular has not yet executed it (ngOnInit of the new component is not called).
2820
- // In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
2821
- // So, put a command in the queue which will be executed after the first one is executed.
2822
2304
  if (SubformMagicService.currentCallerMgSubformServiceRef === null)
2823
2305
  this.ExecuteRouteCommand(routeCommand);
2824
2306
  else
@@ -2827,17 +2309,12 @@
2827
2309
  if (refreshNeeded)
2828
2310
  this.task.refreshView();
2829
2311
  };
2830
- /**
2831
- * Open the subform using a route command
2832
- */
2833
2312
  SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
2834
2313
  var _a;
2835
2314
  var reusingComponent = false;
2836
2315
  var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
2837
2316
  var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
2838
2317
  if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
2839
- // If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
2840
- // So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
2841
2318
  currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
2842
2319
  .then(function (result) {
2843
2320
  SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
@@ -2878,13 +2355,8 @@
2878
2355
  }
2879
2356
  });
2880
2357
  };
2881
- /**
2882
- * @ignore
2883
- */
2884
2358
  SubformMagicService.prototype.init = function () {
2885
2359
  var _this = this;
2886
- // If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
2887
- // So, execute them now.
2888
2360
  var pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
2889
2361
  if (pendingCommands.length > 0) {
2890
2362
  pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
@@ -2892,15 +2364,9 @@
2892
2364
  }
2893
2365
  this.pendingCommandsCollector.stopCollecting();
2894
2366
  };
2895
- /**
2896
- * @ignore
2897
- */
2898
2367
  SubformMagicService.prototype.refreshView = function () {
2899
2368
  this.task.refreshView();
2900
2369
  };
2901
- ///
2902
- // return the relative route
2903
- //
2904
2370
  SubformMagicService.getRelativeRoute = function (sendActivatedRoute) {
2905
2371
  var currentActiveRoute = sendActivatedRoute;
2906
2372
  if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
@@ -2914,72 +2380,39 @@
2914
2380
  }());
2915
2381
  SubformMagicService.currentCallerMgSubformServiceRef = null;
2916
2382
  SubformMagicService.routerContainers = new Array();
2917
- /** @nocollapse */ SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService)); };
2918
- /** @nocollapse */ SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
2919
- /*@__PURE__*/ (function () {
2383
+ SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(i0.NgModuleFactoryLoader), i0.ɵɵinject(i0.Injector)); };
2384
+ SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
2385
+ (function () {
2920
2386
  i0.ɵsetClassMetadata(SubformMagicService, [{
2921
2387
  type: i0.Injectable
2922
- }], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }]; }, null);
2388
+ }], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: i0.NgModuleFactoryLoader }, { type: i0.Injector }]; }, null);
2923
2389
  })();
2924
2390
 
2925
- /**
2926
- * Implements various table-related functionalities
2927
- */
2928
2391
  var TableMagicService = /** @class */ (function () {
2929
- /**
2930
- *
2931
- * @param componentList Component-mapping service
2932
- * @param task Magic task service
2933
- */
2934
2392
  function TableMagicService(componentList, task) {
2935
2393
  this.componentList = componentList;
2936
2394
  this.task = task;
2937
2395
  this.shouldOpenFieldTextEditor = true;
2938
2396
  }
2939
- /**
2940
- * Refreshes the DataSource
2941
- */
2942
2397
  TableMagicService.prototype.refreshDataSource = function () {
2943
2398
  };
2944
- /**
2945
- * Returns the table page size
2946
- */
2947
2399
  TableMagicService.prototype.getPageSize = function () {
2948
2400
  return 10;
2949
2401
  };
2950
- /**
2951
- * Returns max no of rows in the table.
2952
- */
2953
2402
  TableMagicService.prototype.getMaxRowsInTable = function () {
2954
2403
  return this.task.Records.list.length;
2955
2404
  };
2956
- /**
2957
- * Selects the specified row
2958
- * @param rowId The row to select
2959
- */
2960
2405
  TableMagicService.prototype.selectRow = function (rowId) {
2961
2406
  this.selectedItem = rowId;
2962
2407
  };
2963
2408
  TableMagicService.prototype.getSelectedRow = function () {
2964
2409
  return this.selectedItem;
2965
2410
  };
2966
- /**
2967
- * Returns the selected row
2968
- */
2969
2411
  TableMagicService.prototype.selectedRow = function () {
2970
2412
  return null;
2971
2413
  };
2972
- /**
2973
- * Selects the specified page
2974
- * @param pageId The page to select
2975
- */
2976
2414
  TableMagicService.prototype.selectPage = function (pageId) {
2977
2415
  };
2978
- /**
2979
- * Returns whether a dialog should be opened for the HTML element
2980
- * @param element The HTML element for which a dialog may be needed
2981
- * @returns
2982
- */
2983
2416
  TableMagicService.prototype.OpenDialogForControl = function (element) {
2984
2417
  if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
2985
2418
  element.tagName === "INPUT" ||
@@ -2987,34 +2420,17 @@
2987
2420
  return false;
2988
2421
  return true;
2989
2422
  };
2990
- /**
2991
- * Returns the dialog used to edit values
2992
- */
2993
2423
  TableMagicService.prototype.getDialog = function () {
2994
2424
  return null;
2995
2425
  };
2996
- /**
2997
- * Handles the table "scrolled" event
2998
- */
2999
2426
  TableMagicService.prototype.onScrollDown = function () {
3000
2427
  this.task.onScrollDown();
3001
2428
  };
3002
- /**
3003
- * To be overwitten in specific implelemtations
3004
- */
3005
2429
  TableMagicService.prototype.sortData = function (e) { };
3006
- /**
3007
- * To be overwitten in specific implelemtations
3008
- */
3009
2430
  TableMagicService.prototype.mgOnPaginateChange = function (e) { };
3010
2431
  TableMagicService.prototype.mgOptionChanged = function (e) { };
3011
- /**
3012
- * Change the number of lines in a table
3013
- * @param size New number of lines in table
3014
- */
3015
2432
  TableMagicService.prototype.updateTableSize = function (size) {
3016
- if (size === 0) // never remove row 0 for now
3017
- {
2433
+ if (size === 0) {
3018
2434
  size = 1;
3019
2435
  this.task.Records.clearFirstTableRecord(this.task.template);
3020
2436
  }
@@ -3022,17 +2438,11 @@
3022
2438
  this.task.Records.updateSize(size);
3023
2439
  this.task.setIncludesFirst(false);
3024
2440
  };
3025
- /**
3026
- * @ignore
3027
- */
3028
2441
  TableMagicService.prototype.setTableTopIndex = function (value) {
3029
2442
  if (!this.task.Records.includesFirst)
3030
2443
  value++;
3031
2444
  this.task.Records.setGuiTopIndex(value);
3032
2445
  };
3033
- /**
3034
- * @ignore
3035
- */
3036
2446
  TableMagicService.prototype.getTableTopIndex = function () {
3037
2447
  var topIndex = this.task.Records.getGuiTopIndex();
3038
2448
  if (!this.task.Records.includesFirst)
@@ -3041,60 +2451,37 @@
3041
2451
  };
3042
2452
  return TableMagicService;
3043
2453
  }());
3044
- /** @nocollapse */ TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
3045
- /** @nocollapse */ TableMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
3046
- /*@__PURE__*/ (function () {
2454
+ TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
2455
+ TableMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
2456
+ (function () {
3047
2457
  i0.ɵsetClassMetadata(TableMagicService, [{
3048
2458
  type: i0.Injectable
3049
2459
  }], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null);
3050
2460
  })();
3051
2461
 
3052
- /**
3053
- * Enables changing the browser title using Magic expression (SetTitle)
3054
- */
3055
2462
  var TitleMagicService = /** @class */ (function () {
3056
- /**
3057
- *
3058
- * @param titleService Angular's title-changing class
3059
- */
3060
2463
  function TitleMagicService(titleService) {
3061
2464
  this.titleService = titleService;
3062
2465
  }
3063
- /**
3064
- * Set the new title of the window
3065
- * @param newTitle New title of the window
3066
- */
3067
2466
  TitleMagicService.prototype.setTitle = function (newTitle) {
3068
2467
  this.titleService.setTitle(newTitle);
3069
2468
  };
3070
2469
  return TitleMagicService;
3071
2470
  }());
3072
- /** @nocollapse */ TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
3073
- /** @nocollapse */ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
3074
- /*@__PURE__*/ (function () {
2471
+ TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
2472
+ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
2473
+ (function () {
3075
2474
  i0.ɵsetClassMetadata(TitleMagicService, [{
3076
2475
  type: i0.Injectable
3077
2476
  }], function () { return [{ type: i1$1.Title }]; }, null);
3078
2477
  })();
3079
2478
 
3080
- /**
3081
- * Provides the UI with values calculated by the Magic WebClient
3082
- */
3083
2479
  var AccessorMagicService = /** @class */ (function () {
3084
- /**
3085
- * @ignore
3086
- */
3087
2480
  function AccessorMagicService(task) {
3088
2481
  this.task = task;
3089
2482
  this.Logger = null;
3090
2483
  this.Logger = utils$1.Logger.Instance;
3091
2484
  }
3092
- /**
3093
- * Checks if the control is read-only
3094
- * @param controlId Id of control
3095
- * @returns Is the control not read-only
3096
- */
3097
- // CheckReadOnly
3098
2485
  AccessorMagicService.prototype.checkIsReadOnly = function (controlId) {
3099
2486
  var properties;
3100
2487
  properties = this.task.Records.list[0].getControlMetadata(controlId);
@@ -3103,99 +2490,45 @@
3103
2490
  else
3104
2491
  return true;
3105
2492
  };
3106
- /**
3107
- * Returns the text of the control
3108
- * @param controlId Id of control
3109
- * @param rowId Id of row, if applicable
3110
- * @returns The text of the control
3111
- */
3112
- // mgGetText
3113
2493
  AccessorMagicService.prototype.getText = function (controlId, rowId) {
3114
2494
  return this.task.getProperty(controlId, gui.HtmlProperties.Text, rowId);
3115
2495
  };
3116
- /**
3117
- * Gets the text of the tab page
3118
- * @param controlId Id of control
3119
- * @param layer Id of tabpage
3120
- * @returns Text of tabpage
3121
- */
3122
- // mgGetTabpageText
3123
2496
  AccessorMagicService.prototype.getTabpageText = function (controlId, layer) {
3124
2497
  var items = this.task.getProperty(controlId, gui.HtmlProperties.ItemsList);
3125
2498
  if (typeof items !== "undefined")
3126
2499
  return items[layer].displayValue;
3127
2500
  return "";
3128
2501
  };
3129
- /**
3130
- * Gets the image defined for the control
3131
- * @param controlId Id of control
3132
- * @param rowId Id of row, if applicable
3133
- * @returns Image set on control
3134
- */
3135
- // mgGetImage
3136
2502
  AccessorMagicService.prototype.getImage = function (controlId, rowId) {
3137
2503
  var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
3138
2504
  return result;
3139
2505
  };
3140
- /**
3141
- * Returns whether an image is set for this control
3142
- * @param controlId Id of control
3143
- * @param rowId Id of row, if applicable
3144
- * @returns returns true if control has an image set on it
3145
- */
3146
- // mgIsImageExists
3147
2506
  AccessorMagicService.prototype.isImageExists = function (controlId, rowId) {
3148
2507
  var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
3149
2508
  return !util.isNullOrUndefined(result);
3150
2509
  };
3151
- /**
3152
- * Gets the CSS classes set on the control
3153
- * @param controlId Id of control
3154
- * @param rowId Id of row, if applicable
3155
- * @returns The classes for this control
3156
- */
3157
- // mgGetClasses
3158
2510
  AccessorMagicService.prototype.getClasses = function (controlId, rowId) {
3159
2511
  return this.task.getClasses(controlId, rowId);
3160
2512
  };
3161
- /**
3162
- * Gets the CSS styles set on the control
3163
- * @param controlId Id of control
3164
- * @param styleName NAme of style requested
3165
- * @param rowId Id of row, if applicable
3166
- * @returns The style set on the control
3167
- */
3168
- // mgGetStyle
3169
2513
  AccessorMagicService.prototype.getStyle = function (controlId, styleName, rowId) {
3170
2514
  var style = this.task.getStyle(controlId, styleName, rowId);
3171
2515
  return style;
3172
2516
  };
3173
- /**
3174
- * Returns whether a control is visible or not
3175
- * @param controlId Id of control
3176
- * @param rowId Id of row, if applicable
3177
- * @returns Is the control visible or hidden
3178
- */
3179
- // mgGetVisible
3180
2517
  AccessorMagicService.prototype.getVisible = function (controlId, rowId) {
3181
2518
  var vis = this.getProperty(controlId, gui.HtmlProperties.Visible, rowId);
3182
2519
  return vis ? 'visible' : 'hidden';
3183
2520
  };
3184
- /**
3185
- * Returns object representing numeric picture
3186
- * @param picture string which is defined in magic
3187
- * @returns object representing numeric picture
3188
- */
3189
- // mgGetNumericPicture
3190
2521
  AccessorMagicService.prototype.getNumericPicture = function (picture) {
3191
2522
  if (util.isNullOrUndefined(picture))
3192
2523
  return null;
3193
2524
  var pic = new gui.PIC(picture, utils$1.StorageAttribute.NUMERIC, 0);
3194
2525
  var obj = {};
3195
- if (pic.getPosPref_().length > 0)
3196
- obj['prefix'] = pic.getPosPref_();
3197
- else
3198
- obj['prefix'] = "";
2526
+ obj['prefix'] = "";
2527
+ if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
2528
+ var pref = '-' + pic.getPosPref_();
2529
+ if (pref == pic.getNegPref_())
2530
+ obj['prefix'] = pic.getPosPref_();
2531
+ }
3199
2532
  if (pic.getPosSuff_().length > 0)
3200
2533
  obj['suffix'] = pic.getPosSuff_();
3201
2534
  else
@@ -3217,128 +2550,51 @@
3217
2550
  obj['wholes'] = pic.getWholes();
3218
2551
  return obj;
3219
2552
  };
3220
- /**
3221
- * Returns whether a control should have the "required" attribute set on it
3222
- * @param controlId Id of control
3223
- * @param rowId Id of row, if applicable
3224
- * @returns
3225
- */
3226
- // mgGetMustInput
3227
2553
  AccessorMagicService.prototype.getMustInput = function (controlId, rowId) {
3228
2554
  var vis = this.getProperty(controlId, gui.HtmlProperties.MustInput, rowId);
3229
2555
  return vis ? 'true' : 'false';
3230
2556
  };
3231
- /**
3232
- * Returns whether a control is disabled
3233
- * @param controlId Id of control
3234
- * @param rowId Id of row, if applicable
3235
- * @returns
3236
- */
3237
- // mgIsDisabled
3238
2557
  AccessorMagicService.prototype.isDisabled = function (controlId, rowId) {
3239
2558
  var result = this.getProperty(controlId, gui.HtmlProperties.Enabled, rowId);
3240
2559
  return result === true ? null : true;
3241
2560
  };
3242
- /**
3243
- * @ignore
3244
- */
3245
- // getProperty (not changed)
3246
2561
  AccessorMagicService.prototype.getProperty = function (controlId, prop, rowId) {
3247
2562
  return this.task.getProperty(controlId, prop, rowId);
3248
2563
  };
3249
- /**
3250
- * Returns the title (tooltip) text of the control
3251
- * @param controlId Id of control
3252
- * @param rowId Id of row, if applicable
3253
- * @returns
3254
- */
3255
- // mgGetTitle
3256
2564
  AccessorMagicService.prototype.getTitle = function (controlId, rowId) {
3257
2565
  return this.task.getProperty(controlId, gui.HtmlProperties.Tooltip, rowId);
3258
2566
  };
3259
- /**
3260
- * Returns the title (tooltip) text of the control
3261
- * @param controlId Id of control
3262
- * @param rowId Id of row, if applicable
3263
- * @returns
3264
- */
3265
- // mgGetTitle for zoom button
3266
2567
  AccessorMagicService.prototype.getZoomButtonTitle = function (controlId, rowId) {
3267
2568
  return this.task.getProperty(controlId, gui.HtmlProperties.ZoomButtonTooltip, rowId);
3268
2569
  };
3269
- /**
3270
- * Gets the selection control's selected value
3271
- * @param controlId Id of control
3272
- * @param rowId Id of row, if applicable
3273
- * @returns
3274
- */
3275
- // getSelectedValue
3276
2570
  AccessorMagicService.prototype.getSelectedValue = function (controlId, rowId) {
3277
2571
  return this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue, rowId);
3278
2572
  };
3279
- /**
3280
- * Gets the place-holder text of the control
3281
- * @param controlId Id of control
3282
- * @param rowId Id of row, if applicable
3283
- * @returns
3284
- */
3285
- // mgGetPlaceholder
3286
2573
  AccessorMagicService.prototype.getPlaceholder = function (controlId, rowId) {
3287
2574
  return this.task.getProperty(controlId, gui.HtmlProperties.PlaceHolder, rowId);
3288
2575
  };
3289
- /**
3290
- * Returns a type for input controls - should the control be a simple text or a password control
3291
- * @param controlId Id of control
3292
- * @param rowId Id of row, if applicable
3293
- * @returns
3294
- */
3295
- // mgGetType
3296
2576
  AccessorMagicService.prototype.getType = function (controlId, rowId) {
3297
2577
  var result = this.task.getProperty(controlId, gui.HtmlProperties.Password, rowId);
3298
2578
  return result ? "password" : "text";
3299
2579
  };
3300
- /**
3301
- * Returns the tab-index of the control
3302
- * @param controlId Id of control
3303
- * @param rowId Id of row, if applicable
3304
- * @returns
3305
- */
3306
- // mgGetTabIndex
3307
2580
  AccessorMagicService.prototype.getTabIndex = function (controlId, rowId) {
3308
2581
  return this.task.getProperty(controlId, gui.HtmlProperties.TabIndex, rowId);
3309
2582
  };
3310
- /**
3311
- * Returns the value of the control
3312
- * @param controlId Id of control
3313
- * @param rowId Id of row, if applicable
3314
- * @returns
3315
- */
3316
- /// mgGetValue -->
3317
2583
  AccessorMagicService.prototype.getValue = function (controlId, rowId) {
3318
2584
  var val = this.task.getValue(controlId, rowId);
3319
2585
  return val;
3320
2586
  };
3321
- /**
3322
- * Returns the Picture of the control
3323
- * @param controlId Id of control
3324
- * @param rowId Id of row, if applicable
3325
- * @returns
3326
- */
3327
- /// getPicture -->
2587
+ AccessorMagicService.prototype.getFormattedValue = function (controlId, rowId) {
2588
+ var val = this.task.getValue(controlId, rowId);
2589
+ val = this.task.getFormattedValue(controlId, val);
2590
+ return val;
2591
+ };
3328
2592
  AccessorMagicService.prototype.getPicture = function (controlId, rowId) {
3329
2593
  if (util.isNullOrUndefined(controlId))
3330
2594
  return null;
3331
2595
  var pic = this.task.GetControlPictureMask(controlId);
3332
2596
  return (pic != null) ? pic.getFormat().toString() : null;
3333
2597
  };
3334
- /**
3335
- * Returns the custom (user) properties of the control
3336
- * @param controlId Id of control
3337
- * @param propertyName Name of requested property
3338
- * @param rowId Id of row, if applicable
3339
- * @returns
3340
- */
3341
- // mgGetCustomProperty
3342
2598
  AccessorMagicService.prototype.getCustomProperty = function (controlId, propertyNameOrRowID, rowId) {
3343
2599
  if (controlId.indexOf('~') == -1)
3344
2600
  return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
@@ -3363,22 +2619,19 @@
3363
2619
  }
3364
2620
  return userProperties;
3365
2621
  };
3366
- /**
3367
- * Gets the values of the items of a selection control
3368
- * @param id Id of control
3369
- * @param rowId Id of row, if applicable
3370
- * @returns
3371
- */
3372
- // mgGetItemListValues
3373
2622
  AccessorMagicService.prototype.getItemListValues = function (id, rowId) {
3374
2623
  return this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
3375
2624
  };
3376
- /**
3377
- * Gets the display value of the item from items of a selection control
3378
- * @param id Id of control
3379
- * @param rowId Id of row, if applicable
3380
- * @returns
3381
- */
2625
+ AccessorMagicService.prototype.getFilteredList = function (controlId, rowId) {
2626
+ if (util.isNullOrUndefined(rowId))
2627
+ rowId = '0';
2628
+ var items = this.getItemListValues(controlId, rowId);
2629
+ var value = this.task.getFormControl(rowId, controlId).value;
2630
+ if (value !== null && value !== "")
2631
+ return items.filter(function (option) { return option.displayValue.toLowerCase().includes(value); });
2632
+ else
2633
+ return items;
2634
+ };
3382
2635
  AccessorMagicService.prototype.getDisplayValue = function (id, rowId) {
3383
2636
  var displayValue = "";
3384
2637
  var o = this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
@@ -3387,12 +2640,6 @@
3387
2640
  displayValue = o[value].displayValue;
3388
2641
  return displayValue;
3389
2642
  };
3390
- /**
3391
- * Returns whether a tab page is selected or not
3392
- * @param index of current option in iterarotr
3393
- * @param control Id of list control
3394
- * @returns
3395
- */ // isOptionSelected
3396
2643
  AccessorMagicService.prototype.isOptionSelected = function (index, controlId) {
3397
2644
  var e_1, _a;
3398
2645
  var val = this.task.getValue(controlId, "0");
@@ -3412,40 +2659,18 @@
3412
2659
  }
3413
2660
  return false;
3414
2661
  };
3415
- /**
3416
- * Returns whether a tab page is selected or not - used for the tab buttons
3417
- * @param controlId Id of control
3418
- * @param layer Id of the tab page
3419
- * @returns
3420
- */ // mgIsTabPageSelected
3421
2662
  AccessorMagicService.prototype.isTabPageSelected = function (controlId, layer) {
3422
2663
  var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue);
3423
- return val == (layer - 1); // comparing string to number!
3424
- };
3425
- /**
3426
- * Returns whether a tab page layer is selected or not - used for the div which represents the tab page
3427
- * @param controlId Id of control
3428
- * @param layer Id of the tab page
3429
- * @returns
3430
- */ // mgIsTabLayerSelected
2664
+ return val == (layer - 1);
2665
+ };
3431
2666
  AccessorMagicService.prototype.isTabPageLayerSelected = function (controlId, layer) {
3432
2667
  var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedLayer);
3433
- return val == (layer - 1); // comparing string to number!
2668
+ return val == (layer - 1);
3434
2669
  };
3435
- /**
3436
- * Returns the index of the selected tab page
3437
- * @param controlId Id of control
3438
- * @returns
3439
- */
3440
2670
  AccessorMagicService.prototype.getTabSelectedIndex = function (controlId) {
3441
2671
  var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue);
3442
- return val; // comparing string to number!
2672
+ return val;
3443
2673
  };
3444
- // private methodes
3445
- /**
3446
- * @ignore
3447
- */
3448
- // mgIfRowCreated
3449
2674
  AccessorMagicService.prototype.ifRowCreated = function (row) {
3450
2675
  if (row == null)
3451
2676
  return false;
@@ -3453,48 +2678,25 @@
3453
2678
  var result = this.getFormGroupByRow(rowId);
3454
2679
  return !util.isNullOrUndefined(result);
3455
2680
  };
3456
- /**
3457
- * @ignore
3458
- */
3459
- // mgGetFormGroupByRow
3460
2681
  AccessorMagicService.prototype.getFormGroupByRow = function (id) {
3461
2682
  return this.task.formGroups[id];
3462
2683
  };
3463
- /**
3464
- * @ignore
3465
- */
3466
- // isRowSelected (not changed)
3467
2684
  AccessorMagicService.prototype.isRowSelected = function (controlId, rowId) {
3468
2685
  var selectedRow = this.task.getProperty(controlId, gui.HtmlProperties.SelectedRow, "0");
3469
2686
  return selectedRow == rowId;
3470
2687
  };
3471
- /**
3472
- * Returns whether a row is in edit state
3473
- * @param row
3474
- */
3475
2688
  AccessorMagicService.prototype.isRowInRowEditing = function (row) {
3476
2689
  var guiRowId = '0';
3477
2690
  guiRowId = typeof row == "number" ? row.toString() : row.rowId;
3478
2691
  return this.task.isRowInRowEditing(guiRowId);
3479
2692
  };
3480
- /**
3481
- * Returns whether a row is in edit state, use this method while control outside table control
3482
- * @param row
3483
- */
3484
2693
  AccessorMagicService.prototype.isCurrentInRowEditing = function () {
3485
2694
  var row = this.task.tableService.getSelectedRow();
3486
2695
  return this.task.isRowInRowEditing(row);
3487
2696
  };
3488
- /**
3489
- * @ignore
3490
- */
3491
- // GetGuiTopIndex
3492
2697
  AccessorMagicService.prototype.guiTopIndex = function () {
3493
2698
  return this.task.tableService.getTableTopIndex();
3494
2699
  };
3495
- /**
3496
- * @ignore
3497
- */
3498
2700
  AccessorMagicService.prototype.getErrMsg = function (id, rowId) {
3499
2701
  var e_2, _a;
3500
2702
  var c = this.task.getFormControl(rowId, id);
@@ -3527,12 +2729,6 @@
3527
2729
  }
3528
2730
  return 'unknown error';
3529
2731
  };
3530
- /**
3531
- * Sets a user-supplied value to the specified control
3532
- * @param controlName
3533
- * @param value
3534
- * @param refreshDisplay
3535
- */
3536
2732
  AccessorMagicService.prototype.setValueToControl = function (controlName, value, refreshDisplay) {
3537
2733
  if (typeof refreshDisplay === "undefined")
3538
2734
  refreshDisplay = true;
@@ -3541,31 +2737,17 @@
3541
2737
  guiEvent.param = refreshDisplay;
3542
2738
  this.task.insertEvent(guiEvent);
3543
2739
  };
3544
- /**
3545
- * @ignore
3546
- */
3547
2740
  AccessorMagicService.prototype.isDataviewEmpty = function () {
3548
2741
  return this.task.Records.isEmptyDataView;
3549
2742
  };
3550
- /**
3551
- * simulates a click event on the specified control, for the Magic engine
3552
- * @param controlName
3553
- * @param rowId
3554
- */
3555
2743
  AccessorMagicService.prototype.simulateClick = function (controlName, rowId) {
3556
2744
  if (typeof rowId === "undefined")
3557
2745
  rowId = 0;
3558
2746
  this.task.insertEvent(engine.getGuiEventObj('click', controlName, rowId));
3559
2747
  };
3560
- /**
3561
- * Return Boolean TRUE if user logged in Else it will return FALSE
3562
- */
3563
2748
  AccessorMagicService.prototype.isLoggedIn = function () {
3564
2749
  return this.task.getIsLoggenIn();
3565
2750
  };
3566
- /**
3567
- * Returns JS object containing the records with all table fields.
3568
- */
3569
2751
  AccessorMagicService.prototype.GetFormRecords = function () {
3570
2752
  var _this = this;
3571
2753
  var rowId = 0;
@@ -3573,13 +2755,11 @@
3573
2755
  if (!util.isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
3574
2756
  var recList = this.task.Records.list;
3575
2757
  var tableControls_1 = new Array();
3576
- //Generate list of table fields names
3577
2758
  for (var key in this.task.template) {
3578
2759
  if (this.task.template[key] == '1')
3579
2760
  tableControls_1.push(key);
3580
2761
  }
3581
2762
  recArray = new Array();
3582
- //Update the records as list of objects with values for table fields.
3583
2763
  if (tableControls_1.length > 0) {
3584
2764
  recList.forEach(function (ctrlMetaData) {
3585
2765
  if (_this.task.Records.isRowCreated(rowId)) {
@@ -3595,23 +2775,26 @@
3595
2775
  }
3596
2776
  return recArray;
3597
2777
  };
2778
+ AccessorMagicService.prototype.SetCookie = function (name, value, expires, path, domain, secure, sameSite) {
2779
+ engine.CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
2780
+ };
2781
+ AccessorMagicService.prototype.GetCookie = function (name) {
2782
+ return engine.CookieService.getCookie(name);
2783
+ };
2784
+ AccessorMagicService.prototype.DeleteCookie = function (name) {
2785
+ return engine.CookieService.deleteCookie(name);
2786
+ };
3598
2787
  return AccessorMagicService;
3599
2788
  }());
3600
- /** @nocollapse */ AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService)); };
3601
- /** @nocollapse */ AccessorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
3602
- /*@__PURE__*/ (function () {
2789
+ AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService)); };
2790
+ AccessorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
2791
+ (function () {
3603
2792
  i0.ɵsetClassMetadata(AccessorMagicService, [{
3604
2793
  type: i0.Injectable
3605
2794
  }], function () { return [{ type: TaskMagicService }]; }, null);
3606
2795
  })();
3607
2796
 
3608
- /**
3609
- * Central place for adding the Magic services
3610
- */
3611
2797
  var MagicServices = /** @class */ (function () {
3612
- /**
3613
- * @ignore
3614
- */
3615
2798
  function MagicServices(task, subformService, tableService, titleService, mgAccessorService) {
3616
2799
  this.task = task;
3617
2800
  this.subformService = subformService;
@@ -3625,36 +2808,21 @@
3625
2808
  }
3626
2809
  return MagicServices;
3627
2810
  }());
3628
- /** @nocollapse */ MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
3629
- /** @nocollapse */ MagicServices.ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
3630
- /*@__PURE__*/ (function () {
2811
+ MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
2812
+ MagicServices.ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
2813
+ (function () {
3631
2814
  i0.ɵsetClassMetadata(MagicServices, [{
3632
2815
  type: i0.Injectable
3633
2816
  }], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null);
3634
2817
  })();
3635
2818
 
3636
- /**
3637
- * Base component representing a Magic task
3638
- */
3639
2819
  var TaskBaseMagicComponent = /** @class */ (function () {
3640
- /**
3641
- *
3642
- * @param ref changes-detector object
3643
- * @param magicServices Access point for all Magic services
3644
- */
3645
2820
  function TaskBaseMagicComponent(ref, magicServices) {
3646
2821
  this.ref = ref;
3647
2822
  this.magicServices = magicServices;
3648
- /**
3649
- * @ignore
3650
- */
3651
2823
  this.magicProperties = utils$1.MagicProperties;
3652
2824
  }
3653
2825
  Object.defineProperty(TaskBaseMagicComponent.prototype, "task", {
3654
- /**
3655
- * Returns the Magic task service
3656
- * @returns
3657
- */
3658
2826
  get: function () {
3659
2827
  return this.magicServices.task;
3660
2828
  },
@@ -3662,10 +2830,6 @@
3662
2830
  configurable: true
3663
2831
  });
3664
2832
  Object.defineProperty(TaskBaseMagicComponent.prototype, "mgSub", {
3665
- /**
3666
- * Returns the Magic subform service
3667
- * @returns
3668
- */
3669
2833
  get: function () {
3670
2834
  return this.magicServices.subformService;
3671
2835
  },
@@ -3673,10 +2837,6 @@
3673
2837
  configurable: true
3674
2838
  });
3675
2839
  Object.defineProperty(TaskBaseMagicComponent.prototype, "tableService", {
3676
- /**
3677
- * Returns the Magic table service
3678
- * @returns
3679
- */
3680
2840
  get: function () {
3681
2841
  return this.magicServices.tableService;
3682
2842
  },
@@ -3684,10 +2844,6 @@
3684
2844
  configurable: true
3685
2845
  });
3686
2846
  Object.defineProperty(TaskBaseMagicComponent.prototype, "mg", {
3687
- /**
3688
- * Returns the Magic accessor service
3689
- * @returns
3690
- */
3691
2847
  get: function () {
3692
2848
  return this.magicServices.mgAccessorService;
3693
2849
  },
@@ -3695,10 +2851,6 @@
3695
2851
  configurable: true
3696
2852
  });
3697
2853
  Object.defineProperty(TaskBaseMagicComponent.prototype, "taskId", {
3698
- /**
3699
- * Returns the task Id
3700
- * @returns
3701
- */
3702
2854
  get: function () {
3703
2855
  return this.task.taskId;
3704
2856
  },
@@ -3706,19 +2858,12 @@
3706
2858
  configurable: true
3707
2859
  });
3708
2860
  Object.defineProperty(TaskBaseMagicComponent.prototype, "screenFormGroup", {
3709
- /**
3710
- * Returns the FormGroup for screen-mode forms
3711
- * @returns
3712
- */
3713
2861
  get: function () {
3714
2862
  return this.task.ScreenModeControls;
3715
2863
  },
3716
2864
  enumerable: false,
3717
2865
  configurable: true
3718
2866
  });
3719
- /**
3720
- * Interface implementation
3721
- */
3722
2867
  TaskBaseMagicComponent.prototype.ngOnInit = function () {
3723
2868
  var _this = this;
3724
2869
  var subscription = this.task.detectChanges.pipe().subscribe(function (c) {
@@ -3727,48 +2872,19 @@
3727
2872
  this.task.initTask(this.taskIdParam, this.taskDescription);
3728
2873
  this.createFormControlsAccessor(this.screenFormGroup);
3729
2874
  this.setInputDateFormat();
3730
- // subcribe to custom property changes
3731
2875
  this.task.customPropertiesSubject.pipe().subscribe(function (property) {
3732
2876
  _this.PropertyChanged(property.propertyName, property.rowId, property.value);
3733
2877
  });
3734
- // subcribe to records count changes
3735
2878
  this.task.recordsCountChangeSubject.pipe().subscribe(function (value) {
3736
2879
  _this.RecordsCountChanged(value);
3737
2880
  });
3738
2881
  };
3739
- /**
3740
- * @ignore
3741
- */
3742
2882
  TaskBaseMagicComponent.prototype.createFormControlsAccessor = function (formGroup) { };
3743
- /**
3744
- * @ignore
3745
- */
3746
2883
  TaskBaseMagicComponent.prototype.setInputDateFormat = function () { };
3747
- /**
3748
- * This method is called when the value of any custom property is updated in Magic
3749
- * propertyName : name of property which is updated. The format is <controlname>~<propertyname>
3750
- * rowId : row number of the updated property for controls in table control (0 for controls outside table)
3751
- * value : updated value of the property
3752
- * @returns : void
3753
- * To use the method override it in your component and check the property name and write you code ..for eg
3754
- * if(propertyName == 'controlname~propertyName') {// your code}
3755
- * else { // your code}
3756
- */
3757
2884
  TaskBaseMagicComponent.prototype.PropertyChanged = function (propertyName, rowId, value) {
3758
- // intentionally left blank because the implementation should be in the derived class
3759
- };
3760
- /**
3761
- * Records count change subject is subscribed to change in its value. This method will be called
3762
- * as the value of records count is received at from server.
3763
- * @returns : void
3764
- * To use the method override it in your component.
3765
- */
2885
+ };
3766
2886
  TaskBaseMagicComponent.prototype.RecordsCountChanged = function (recordsCount) {
3767
- // intentionally left blank because the implementation should be in the derived class
3768
2887
  };
3769
- /**
3770
- * Interface implementation
3771
- */
3772
2888
  TaskBaseMagicComponent.prototype.ngAfterViewInit = function () {
3773
2889
  this.mgSub.init();
3774
2890
  };
@@ -3778,17 +2894,14 @@
3778
2894
  this.task.oldPageSize = this.tableService.getPageSize();
3779
2895
  }
3780
2896
  };
3781
- /**
3782
- * Interface implementation
3783
- */
3784
2897
  TaskBaseMagicComponent.prototype.ngOnDestroy = function () {
3785
2898
  this.task.dispose();
3786
2899
  };
3787
2900
  return TaskBaseMagicComponent;
3788
2901
  }());
3789
- /** @nocollapse */ TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
3790
- /** @nocollapse */ TaskBaseMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
3791
- /*@__PURE__*/ (function () {
2902
+ TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
2903
+ TaskBaseMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
2904
+ (function () {
3792
2905
  i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
3793
2906
  type: i0.Component,
3794
2907
  args: [{
@@ -3803,22 +2916,13 @@
3803
2916
  }] });
3804
2917
  })();
3805
2918
 
3806
- /**
3807
- * @ignore
3808
- */
3809
2919
  var RowMagicDirective = /** @class */ (function () {
3810
2920
  function RowMagicDirective(_task, element) {
3811
2921
  this._task = _task;
3812
2922
  this.element = element;
3813
- /**
3814
- * @ignore
3815
- */
3816
2923
  this.rowChangedSubscriber = null;
3817
2924
  this.htmlElement = this.element.nativeElement;
3818
2925
  }
3819
- /**
3820
- * Initializes this object
3821
- */
3822
2926
  RowMagicDirective.prototype.ngOnInit = function () {
3823
2927
  var _this = this;
3824
2928
  this.rowChangedSubscriber = this._task
@@ -3834,16 +2938,7 @@
3834
2938
  return (rect.top >= parentRect.top &&
3835
2939
  rect.bottom <= parentRect.bottom);
3836
2940
  };
3837
- /**
3838
- * Cleanup
3839
- */
3840
2941
  RowMagicDirective.prototype.ngOnDestroy = function () {
3841
- // Don't know why, but when the table is loaded for the first time, we
3842
- // get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
3843
- // for number of rows in the page but here this.rowId is undefined.
3844
- // Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
3845
- // is null and hence crashes.
3846
- // So, the condition to check nulity is added.
3847
2942
  if (this.rowChangedSubscriber !== null) {
3848
2943
  this.rowChangedSubscriber.unsubscribe();
3849
2944
  }
@@ -3856,13 +2951,13 @@
3856
2951
  };
3857
2952
  return RowMagicDirective;
3858
2953
  }());
3859
- /** @nocollapse */ RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
3860
- /** @nocollapse */ RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) {
2954
+ RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
2955
+ RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) {
3861
2956
  if (rf & 1) {
3862
2957
  i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
3863
2958
  }
3864
2959
  }, inputs: { rowId: ["magicRow", "rowId"] } });
3865
- /*@__PURE__*/ (function () {
2960
+ (function () {
3866
2961
  i0.ɵsetClassMetadata(RowMagicDirective, [{
3867
2962
  type: i0.Directive,
3868
2963
  args: [{
@@ -3877,35 +2972,16 @@
3877
2972
  }] });
3878
2973
  })();
3879
2974
 
3880
- /**
3881
- * Connects HTML elements to the Magic Web Client engine
3882
- */
3883
2975
  var MagicDirective = /** @class */ (function () {
3884
- /**
3885
- *
3886
- * @param _task The task service
3887
- * @param element The element for which the directive is applied
3888
- * @param renderer Renderer for the element
3889
- * @param vcRef
3890
- * @param magicRow
3891
- */
3892
2976
  function MagicDirective(_task, element, renderer, vcRef, magicRow) {
3893
2977
  this._task = _task;
3894
2978
  this.element = element;
3895
2979
  this.renderer = renderer;
3896
2980
  this.vcRef = vcRef;
3897
2981
  this.magicRow = magicRow;
3898
- /**
3899
- * Collection of event handlers for this element
3900
- */
3901
2982
  this.eventHandlers = {};
3902
2983
  this.eventsOnlyVal = false;
3903
2984
  this.htmlElement = this.element.nativeElement;
3904
- //let c = (<any>this.vcRef)._view;
3905
- //while (!(c instanceof TaskBaseMagicComponent)) {
3906
- // c = c.component;
3907
- //}
3908
- //this.component = c;
3909
2985
  if (!(typeof magicRow === 'undefined' || magicRow === null))
3910
2986
  this.rowId = magicRow.rowId;
3911
2987
  }
@@ -3919,9 +2995,6 @@
3919
2995
  });
3920
2996
  ;
3921
2997
  Object.defineProperty(MagicDirective.prototype, "eventsOnly", {
3922
- /**
3923
- * This flag is used when we only want to register to events, but do not want to execute commands sent from server
3924
- */
3925
2998
  set: function (val) {
3926
2999
  console.log('eventsOnly');
3927
3000
  this.eventsOnlyVal = true;
@@ -3931,36 +3004,25 @@
3931
3004
  });
3932
3005
  ;
3933
3006
  Object.defineProperty(MagicDirective.prototype, "task", {
3934
- /**
3935
- * Get the task service
3936
- * @returns
3937
- */
3938
3007
  get: function () {
3939
3008
  return this._task;
3940
3009
  },
3941
3010
  enumerable: false,
3942
3011
  configurable: true
3943
3012
  });
3944
- /**
3945
- * Register to the events this element may need to handle
3946
- */
3947
3013
  MagicDirective.prototype.regEvents = function () {
3948
3014
  var _this = this;
3949
- // Handle events for which event handler may be removed and restored
3950
3015
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
3951
3016
  Object.keys(this.eventHandlers).forEach(function (key) {
3952
3017
  _this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
3953
3018
  });
3954
- // Handle events with anonymous event handlers
3955
- var events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
3019
+ var events = ['click', 'mousedown', 'dblclick'];
3956
3020
  events.forEach(function (event) {
3957
3021
  _this.renderer.listen(_this.htmlElement, event, function (e) {
3958
- // check if the event is fired from zoom button ( to identify the connected zoom button in engine)
3959
3022
  var fromButton = false;
3960
3023
  if (_this.htmlElement instanceof HTMLButtonElement)
3961
3024
  fromButton = true;
3962
3025
  _this.task.insertEvent(engine.getGuiEventObj(event, _this.id, +_this.rowId, fromButton));
3963
- e.cancelBubble = true;
3964
3026
  });
3965
3027
  });
3966
3028
  this.renderer.listen(this.htmlElement, 'change', function (e) {
@@ -3971,13 +3033,10 @@
3971
3033
  _this.task.insertEvent(guiEvent);
3972
3034
  }
3973
3035
  });
3974
- // handle the input event
3975
3036
  fromEvent.fromEvent(this.htmlElement, 'input').pipe(operators.map(function (event) {
3976
3037
  return event.target.value;
3977
- }), operators.debounceTime(200) // time after which value will be sent to magic
3978
- ).subscribe(function (x) {
3038
+ }), operators.debounceTime(200)).subscribe(function (x) {
3979
3039
  if (_this.task.getProperty(_this.id, gui.HtmlProperties.BindingLevel, _this.rowId) === utils$1.BindingLevel.Character) {
3980
- // Don't support character binding for date/time values
3981
3040
  var attribute = _this.task.Records.list[0].getControlMetadata(_this.id).dataType;
3982
3041
  if (attribute !== utils$1.StorageAttributeType.Date && attribute != utils$1.StorageAttributeType.Time)
3983
3042
  _this.task.mgAccessorService.setValueToControl(_this.id, x, true);
@@ -4003,25 +3062,16 @@
4003
3062
  (e.keyCode >= gui.GuiConstants.KEY_F1 && e.keyCode <= gui.GuiConstants.KEY_F12);
4004
3063
  if (guiEvent.modifiers !== gui.Modifiers.MODIFIER_NONE || supportedKey) {
4005
3064
  guiEvent.keyCode = e.keyCode;
4006
- // Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
4007
3065
  if (e.keyCode !== gui.GuiConstants.KEY_ESC || e.keyCode === gui.GuiConstants.KEY_ESC && !MagicDirective.opened)
4008
3066
  e.cancelBubble = true;
4009
3067
  _this.task.insertEvent(guiEvent);
4010
3068
  }
4011
3069
  });
4012
3070
  };
4013
- /**
4014
- * Handle focus event
4015
- */
4016
3071
  MagicDirective.prototype.OnFocus = function () {
4017
3072
  this.task.insertEvent(engine.getGuiEventObj('focus', this.id, +this.rowId));
4018
3073
  event.cancelBubble = true;
4019
3074
  };
4020
- /**
4021
- * Is the command's element the same as this directive's element
4022
- * @param command
4023
- * @returns true/false
4024
- */
4025
3075
  MagicDirective.prototype.IsSameElement = function (command) {
4026
3076
  var line = command.line;
4027
3077
  if (this.task.isTableControl(command.CtrlName))
@@ -4030,17 +3080,9 @@
4030
3080
  (line === +this.rowId ||
4031
3081
  (line === 0 && util.isNullOrUndefined(this.rowId))));
4032
3082
  };
4033
- /**
4034
- * Is the command's element the same as this directive's component
4035
- * @param command
4036
- * @returns true/false
4037
- */
4038
3083
  MagicDirective.prototype.IsSameComponent = function (command) {
4039
3084
  return (command.controlName === this.id);
4040
3085
  };
4041
- /**
4042
- * @ignore
4043
- */
4044
3086
  MagicDirective.prototype.regUpdatesUI = function () {
4045
3087
  var _this = this;
4046
3088
  this.subscribeRefreshDom = this.task
@@ -4063,17 +3105,10 @@
4063
3105
  _this.handleInteractiveCommands(command);
4064
3106
  });
4065
3107
  };
4066
- /**
4067
- * Initializes this object
4068
- */
4069
3108
  MagicDirective.prototype.ngOnInit = function () {
4070
3109
  this.regEvents();
4071
3110
  this.regUpdatesUI();
4072
3111
  };
4073
- /**
4074
- * Handles the commands received from the Magic WebClient engine
4075
- * @param command
4076
- */
4077
3112
  MagicDirective.prototype.handleCommand = function (command) {
4078
3113
  switch (command.CommandType) {
4079
3114
  case gui.CommandType.SET_PROPERTY:
@@ -4081,16 +3116,12 @@
4081
3116
  break;
4082
3117
  case gui.CommandType.SET_FOCUS:
4083
3118
  this.focusUnlistener();
4084
- // Do not set focus on connected zoom button
4085
3119
  if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
4086
3120
  this.htmlElement.focus();
4087
3121
  this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
4088
3122
  break;
4089
3123
  }
4090
3124
  };
4091
- /**
4092
- * handle the interactive commands like CallJS
4093
- */
4094
3125
  MagicDirective.prototype.handleInteractiveCommands = function (command) {
4095
3126
  switch (command._commandType) {
4096
3127
  case gui.InteractiveCommandType.CALL_JS:
@@ -4100,24 +3131,18 @@
4100
3131
  var resultString = '';
4101
3132
  try {
4102
3133
  if (!util.isNullOrUndefined(magicComponent[methodName])) {
4103
- // invoke the method on instance of magic componenet
4104
3134
  resultString = magicComponent[methodName].apply(magicComponent, args);
4105
3135
  }
4106
3136
  else
4107
- console.error('Instance method ' + methodName + ' does not exists'); // when method is not found
3137
+ console.error('Instance method ' + methodName + ' does not exists');
4108
3138
  }
4109
3139
  catch (e) {
4110
- // any other exception
4111
3140
  console.error(e.message);
4112
3141
  }
4113
- command.resultString = resultString; // update the return value
3142
+ command.resultString = resultString;
4114
3143
  break;
4115
3144
  }
4116
3145
  };
4117
- /**
4118
- * Handle the Magic set-property command
4119
- * @param command
4120
- */
4121
3146
  MagicDirective.prototype.handleSetProperty = function (command) {
4122
3147
  switch (command.Operation) {
4123
3148
  case gui.HtmlProperties.ReadOnly:
@@ -4128,18 +3153,15 @@
4128
3153
  break;
4129
3154
  }
4130
3155
  };
4131
- /**
4132
- * Cleanup
4133
- */
4134
3156
  MagicDirective.prototype.ngOnDestroy = function () {
4135
3157
  this.subscribeRefreshDom.unsubscribe();
4136
3158
  };
4137
3159
  return MagicDirective;
4138
3160
  }());
4139
3161
  MagicDirective.opened = false;
4140
- /** @nocollapse */ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
4141
- /** @nocollapse */ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
4142
- /*@__PURE__*/ (function () {
3162
+ MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
3163
+ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
3164
+ (function () {
4143
3165
  i0.ɵsetClassMetadata(MagicDirective, [{
4144
3166
  type: i0.Directive,
4145
3167
  args: [{
@@ -4160,9 +3182,6 @@
4160
3182
  }] });
4161
3183
  })();
4162
3184
 
4163
- /**
4164
- * @ignore
4165
- */
4166
3185
  var NoControlMagicDirective = /** @class */ (function (_super) {
4167
3186
  __extends(NoControlMagicDirective, _super);
4168
3187
  function NoControlMagicDirective(_task, element, renderer, vcRef, magicRow) {
@@ -4203,12 +3222,10 @@
4203
3222
  }
4204
3223
  }
4205
3224
  };
4206
- // is the div a tab control
4207
3225
  NoControlMagicDirective.prototype.isTabControl = function () {
4208
3226
  return this.htmlElement instanceof HTMLDivElement &&
4209
3227
  this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
4210
3228
  };
4211
- // is the div a radio buttons wrapper
4212
3229
  NoControlMagicDirective.prototype.isRadio = function () {
4213
3230
  return this.htmlElement instanceof HTMLDivElement &&
4214
3231
  this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
@@ -4217,7 +3234,6 @@
4217
3234
  _super.prototype.handleCommand.call(this, command);
4218
3235
  switch (command.CommandType) {
4219
3236
  case gui.CommandType.SET_CLASS:
4220
- //remove the class which was replaced by this new one, as registered in the ControlMetadata
4221
3237
  var controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
4222
3238
  if (controlMetadata.removedClass != '') {
4223
3239
  this.htmlElement.classList.remove(controlMetadata.removedClass);
@@ -4230,7 +3246,7 @@
4230
3246
  this.htmlElement.innerText = command.value;
4231
3247
  if (this.htmlElement instanceof HTMLSelectElement)
4232
3248
  this.htmlElement.value = command.value;
4233
- if (this.htmlElement instanceof HTMLAnchorElement) //hyper-text button
3249
+ if (this.htmlElement instanceof HTMLAnchorElement)
4234
3250
  this.htmlElement.text = command.value;
4235
3251
  if (this.htmlElement instanceof HTMLInputElement) {
4236
3252
  if (this.htmlElement.type === "checkbox") {
@@ -4254,7 +3270,6 @@
4254
3270
  break;
4255
3271
  }
4256
3272
  };
4257
- // handle set-property commands
4258
3273
  NoControlMagicDirective.prototype.handleSetProperty = function (command) {
4259
3274
  var e_1, _a;
4260
3275
  _super.prototype.handleSetProperty.call(this, command);
@@ -4271,7 +3286,6 @@
4271
3286
  break;
4272
3287
  case gui.HtmlProperties.ItemsList:
4273
3288
  if (this.htmlElement instanceof HTMLSelectElement) {
4274
- // clear the list
4275
3289
  var len = this.htmlElement.length;
4276
3290
  for (var i = len - 1; i >= 0; i--) {
4277
3291
  this.htmlElement.remove(i);
@@ -4323,8 +3337,7 @@
4323
3337
  var child = tabControl.children[i];
4324
3338
  var layer = child.getAttribute('layer') - 1;
4325
3339
  if (child instanceof HTMLButtonElement) {
4326
- // set button style
4327
- if (layer == command.obj1) { // compare int to string
3340
+ if (layer == command.obj1) {
4328
3341
  child.classList.add('tab_button_active');
4329
3342
  }
4330
3343
  else {
@@ -4332,7 +3345,6 @@
4332
3345
  }
4333
3346
  }
4334
3347
  else {
4335
- // not a buton - hide unselected tabpages
4336
3348
  var style = (layer == command.obj1) ? 'display: inline' : 'display: none';
4337
3349
  child.setAttribute('style', style);
4338
3350
  }
@@ -4355,9 +3367,9 @@
4355
3367
  };
4356
3368
  return NoControlMagicDirective;
4357
3369
  }(MagicDirective));
4358
- /** @nocollapse */ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
4359
- /** @nocollapse */ NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
4360
- /*@__PURE__*/ (function () {
3370
+ NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
3371
+ NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
3372
+ (function () {
4361
3373
  i0.ɵsetClassMetadata(NoControlMagicDirective, [{
4362
3374
  type: i0.Directive,
4363
3375
  args: [{
@@ -4373,20 +3385,7 @@
4373
3385
  }] });
4374
3386
  })();
4375
3387
 
4376
- /**
4377
- * Mock component, implements routing by connecting the requested URL with the appropriate Magic task
4378
- */
4379
3388
  var RouterContainerMagicComponent = /** @class */ (function () {
4380
- /**
4381
- *
4382
- * @param changeDetectorRef
4383
- * @param activatedRoute
4384
- * @param magic
4385
- * @param componentFactoryResolver
4386
- * @param viewContainerRef
4387
- * @param componentList
4388
- * @param pendingCommandsCollector
4389
- */
4390
3389
  function RouterContainerMagicComponent(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
4391
3390
  this.activatedRoute = activatedRoute;
4392
3391
  this.magic = magic;
@@ -4399,9 +3398,6 @@
4399
3398
  this.componentRef = null;
4400
3399
  this.parentMgSubformService = null;
4401
3400
  }
4402
- /**
4403
- * Initialization
4404
- */
4405
3401
  RouterContainerMagicComponent.prototype.ngOnInit = function () {
4406
3402
  var outletname = this.activatedRoute.outlet;
4407
3403
  var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
@@ -4419,10 +3415,7 @@
4419
3415
  guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
4420
3416
  if (currentActiveRoute.snapshot.outlet !== 'primary')
4421
3417
  guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
4422
- // if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
4423
- // need to take the path form routeConfig.path
4424
3418
  var calcRouterPath = currentActiveRoute.routeConfig.path;
4425
- // add the RouterPath only if exist
4426
3419
  if (calcRouterPath.length > 0) {
4427
3420
  var routerPath = calcRouterPath;
4428
3421
  var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
@@ -4436,7 +3429,6 @@
4436
3429
  };
4437
3430
  RouterContainerMagicComponent.prototype.initializeComponent = function () {
4438
3431
  var _this = this;
4439
- // re-init subformMagicService since it may change after executing "RouterNavigate" event.
4440
3432
  var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
4441
3433
  if (subformMagicService.currentRouteDefinition !== null) {
4442
3434
  var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
@@ -4449,9 +3441,6 @@
4449
3441
  this.parentMgSubformService = subformMagicService;
4450
3442
  subformMagicService.currentRouteDefinition = null;
4451
3443
  SubformMagicService.currentCallerMgSubformServiceRef = null;
4452
- //When the component is initialized, then also we get the notification for paramMap subscription.
4453
- //But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
4454
- //So, control it via ignoreParamChange flag.
4455
3444
  var ignoreParamChange_1 = true;
4456
3445
  myActiveRoute_1.paramMap.subscribe(function (params) {
4457
3446
  if (!ignoreParamChange_1)
@@ -4462,12 +3451,7 @@
4462
3451
  this.routerCommandsMagicService.ExecuteNextCommand();
4463
3452
  }
4464
3453
  };
4465
- /**
4466
- * Cleanup
4467
- */
4468
3454
  RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
4469
- // TODO Routing: Call close() only if the task is not already closed.
4470
- // Task can be closed when a router is overlayed by another task via call operation.
4471
3455
  if (this.componentRef != null) {
4472
3456
  this.componentRef.instance.task.close();
4473
3457
  var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
@@ -4476,9 +3460,9 @@
4476
3460
  };
4477
3461
  return RouterContainerMagicComponent;
4478
3462
  }());
4479
- /** @nocollapse */ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
4480
- /** @nocollapse */ RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
4481
- /*@__PURE__*/ (function () {
3463
+ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
3464
+ RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
3465
+ (function () {
4482
3466
  i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
4483
3467
  type: i0.Component,
4484
3468
  args: [{
@@ -4488,18 +3472,12 @@
4488
3472
  }], function () { return [{ type: i2.ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
4489
3473
  })();
4490
3474
 
4491
- /**
4492
- * @ignore
4493
- */
4494
3475
  var Constants = /** @class */ (function () {
4495
3476
  function Constants() {
4496
3477
  }
4497
3478
  return Constants;
4498
3479
  }());
4499
3480
  Constants.DATE_FMT = 'dd/MMM/yyyy';
4500
- /**
4501
- * @ignore
4502
- */
4503
3481
  var DateMagicPipe = /** @class */ (function (_super) {
4504
3482
  __extends(DateMagicPipe, _super);
4505
3483
  function DateMagicPipe(_task) {
@@ -4513,7 +3491,6 @@
4513
3491
  var mgDateFormatter = new MgDateFormatter();
4514
3492
  if (!util.isNullOrUndefined(value) && mask !== null) {
4515
3493
  formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
4516
- // If control is label control of table, due to query mode, then save the format here.
4517
3494
  if (formatStr != null && this._task.isTableControl(controlId)) {
4518
3495
  if (this._task.mgInputDateFormat == null)
4519
3496
  this._task.mgInputDateFormat = formatStr;
@@ -4528,9 +3505,9 @@
4528
3505
  };
4529
3506
  return DateMagicPipe;
4530
3507
  }(i1.DatePipe));
4531
- /** @nocollapse */ DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
4532
- /** @nocollapse */ DateMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
4533
- /*@__PURE__*/ (function () {
3508
+ DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
3509
+ DateMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
3510
+ (function () {
4534
3511
  i0.ɵsetClassMetadata(DateMagicPipe, [{
4535
3512
  type: i0.Pipe,
4536
3513
  args: [{
@@ -4599,18 +3576,12 @@
4599
3576
  return formatStr.ToString();
4600
3577
  }
4601
3578
  else
4602
- return "dd-mm-yyyy"; // return default format.
3579
+ return "dd-mm-yyyy";
4603
3580
  };
4604
3581
  return MgDateFormatter;
4605
3582
  }());
4606
3583
 
4607
- /**
4608
- * Perform Magic validation on input controls which hold alphanumeric strings
4609
- */
4610
3584
  var MgformatMagicDirective = /** @class */ (function () {
4611
- /**
4612
- * @ignore
4613
- */
4614
3585
  function MgformatMagicDirective(magicDir, _task) {
4615
3586
  this.magicDir = magicDir;
4616
3587
  this._task = _task;
@@ -4618,20 +3589,12 @@
4618
3589
  MgformatMagicDirective.prototype.ngAfterViewInit = function () {
4619
3590
  var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4620
3591
  if (control != null && this._task.mgInputDateFormat == null) {
4621
- // get the first date control's format.
4622
3592
  var pic = this._task.GetControlPictureMask(this.magicDir.id);
4623
3593
  if (pic.getAttr() == utils$1.StorageAttribute.DATE) {
4624
3594
  this.formatDate(pic);
4625
3595
  }
4626
3596
  }
4627
3597
  };
4628
- /**
4629
- * @ignore
4630
- */
4631
- /**
4632
- * This can be used to set pattern
4633
- * On input, verifies the input matches the required mask
4634
- */
4635
3598
  MgformatMagicDirective.prototype.onFocusEvent = function ($event) {
4636
3599
  var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4637
3600
  if (control != null) {
@@ -4656,10 +3619,6 @@
4656
3619
  }
4657
3620
  }
4658
3621
  };
4659
- /**
4660
- * @ignore
4661
- */
4662
- // This can be used to implement uppercase/lower case
4663
3622
  MgformatMagicDirective.prototype.onChangeEvent = function ($event) {
4664
3623
  var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4665
3624
  var attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -4677,9 +3636,6 @@
4677
3636
  var mgDateFormatter = new MgDateFormatter();
4678
3637
  this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
4679
3638
  };
4680
- /**
4681
- * @ignore
4682
- */
4683
3639
  MgformatMagicDirective.prototype.formatAlphaUnicode = function (control) {
4684
3640
  var value = control.value;
4685
3641
  if (value !== null && value.length > 0) {
@@ -4705,9 +3661,6 @@
4705
3661
  control.setValue(valueStr.ToString());
4706
3662
  }
4707
3663
  };
4708
- /**
4709
- * @ignore
4710
- */
4711
3664
  MgformatMagicDirective.prototype.formatBoolean = function (control) {
4712
3665
  var value = control.value;
4713
3666
  if (value !== null && value.length > 0) {
@@ -4720,12 +3673,6 @@
4720
3673
  }
4721
3674
  }
4722
3675
  };
4723
- /**
4724
- * @ignore
4725
- */
4726
- /// <summary>
4727
- /// generate pattern from fld's format
4728
- /// </summary>
4729
3676
  MgformatMagicDirective.prototype.generatePattern = function (attribute, pic) {
4730
3677
  var pattern = "";
4731
3678
  switch (attribute) {
@@ -4739,12 +3686,6 @@
4739
3686
  }
4740
3687
  return pattern;
4741
3688
  };
4742
- /**
4743
- * @ignore
4744
- */
4745
- /// <summary>
4746
- /// generate pattern for Alpha
4747
- /// </summary>
4748
3689
  MgformatMagicDirective.prototype.generatePatternForNumber = function (pic) {
4749
3690
  var patternStr = new mscorelib.StringBuilder();
4750
3691
  patternStr.Append("^");
@@ -4757,9 +3698,6 @@
4757
3698
  patternStr.Append("$");
4758
3699
  return patternStr.ToString();
4759
3700
  };
4760
- /**
4761
- * @ignore
4762
- */
4763
3701
  MgformatMagicDirective.prototype.isPatternGenerationNeeded = function (attr, pic) {
4764
3702
  switch (attr) {
4765
3703
  case utils$1.StorageAttribute.NUMERIC:
@@ -4769,12 +3707,6 @@
4769
3707
  return (pic.getMaskChars() > 0) ? true : false;
4770
3708
  }
4771
3709
  };
4772
- /**
4773
- * @ignore
4774
- */
4775
- /// <summary>
4776
- /// generate pattern for Alpha
4777
- /// </summary>
4778
3710
  MgformatMagicDirective.prototype.generatePatternForAlpha = function (pic) {
4779
3711
  var cnt = 0;
4780
3712
  var inputAllChars = false;
@@ -4785,7 +3717,6 @@
4785
3717
  var pattern = new mscorelib.StringBuilder();
4786
3718
  pattern.Append("^");
4787
3719
  for (var i = 0; i < mask.length;) {
4788
- //start new subset , if mask[i] is one of these.
4789
3720
  if (inputAllChars && (mask.charCodeAt(i) == utils$1.PICInterface.PIC_N || mask.charCodeAt(i) == utils$1.PICInterface.PIC_U || mask.charCodeAt(i) == utils$1.PICInterface.PIC_L
4790
3721
  || mask.charCodeAt(i) == utils$1.PICInterface.PIC_X)) {
4791
3722
  pattern.Append("(");
@@ -4831,13 +3762,9 @@
4831
3762
  pattern.Append("$");
4832
3763
  return pattern.ToString();
4833
3764
  };
4834
- /**
4835
- * @ignore
4836
- */
4837
3765
  MgformatMagicDirective.prototype.getDirectiveCount = function (mask, idx, pattern, changeInPattern) {
4838
3766
  changeInPattern.value = false;
4839
3767
  var patternCount = 0;
4840
- // find max chars
4841
3768
  while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
4842
3769
  patternCount++;
4843
3770
  idx++;
@@ -4846,9 +3773,6 @@
4846
3773
  changeInPattern.value = true;
4847
3774
  return patternCount;
4848
3775
  };
4849
- /**
4850
- * @ignore
4851
- */
4852
3776
  MgformatMagicDirective.prototype.IsPatternMatches = function (mask, pattern) {
4853
3777
  for (var i = 0; i < pattern.length; i++)
4854
3778
  if (mask == pattern[i])
@@ -4857,13 +3781,13 @@
4857
3781
  };
4858
3782
  return MgformatMagicDirective;
4859
3783
  }());
4860
- /** @nocollapse */ MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
4861
- /** @nocollapse */ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
3784
+ MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
3785
+ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
4862
3786
  if (rf & 1) {
4863
3787
  i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
4864
3788
  }
4865
3789
  } });
4866
- /*@__PURE__*/ (function () {
3790
+ (function () {
4867
3791
  i0.ɵsetClassMetadata(MgformatMagicDirective, [{
4868
3792
  type: i0.Directive,
4869
3793
  args: [{
@@ -4878,9 +3802,6 @@
4878
3802
  }] });
4879
3803
  })();
4880
3804
 
4881
- /**
4882
- * @ignore
4883
- */
4884
3805
  var TimeMagicPipe = /** @class */ (function (_super) {
4885
3806
  __extends(TimeMagicPipe, _super);
4886
3807
  function TimeMagicPipe(_task) {
@@ -4919,9 +3840,9 @@
4919
3840
  };
4920
3841
  return TimeMagicPipe;
4921
3842
  }(i1.DatePipe));
4922
- /** @nocollapse */ TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
4923
- /** @nocollapse */ TimeMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
4924
- /*@__PURE__*/ (function () {
3843
+ TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
3844
+ TimeMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
3845
+ (function () {
4925
3846
  i0.ɵsetClassMetadata(TimeMagicPipe, [{
4926
3847
  type: i0.Pipe,
4927
3848
  args: [{
@@ -4930,24 +3851,11 @@
4930
3851
  }], function () { return [{ type: TaskMagicService }]; }, null);
4931
3852
  })();
4932
3853
 
4933
- /**
4934
- * Validates the field range.
4935
- */
4936
3854
  var RangeValidatorMagicDirective = /** @class */ (function () {
4937
- /**
4938
- *
4939
- * @param _task The task service
4940
- * @param vcRef
4941
- */
4942
3855
  function RangeValidatorMagicDirective(_task, vcRef) {
4943
3856
  this._task = _task;
4944
3857
  this.vcRef = vcRef;
4945
3858
  }
4946
- /**
4947
- * Validation method
4948
- * @param c FormControl to validate
4949
- * @returns If validation fails, return error message, else returns null
4950
- */
4951
3859
  RangeValidatorMagicDirective.prototype.validate = function (c) {
4952
3860
  var controlName;
4953
3861
  controlName = this.getControlName(c);
@@ -4969,24 +3877,21 @@
4969
3877
  };
4970
3878
  }
4971
3879
  };
4972
- /**
4973
- * @ignore
4974
- */
4975
3880
  RangeValidatorMagicDirective.prototype.getControlName = function (c) {
4976
3881
  var formGroup = c.parent.controls;
4977
3882
  return Object.keys(formGroup).find(function (name) { return c === formGroup[name]; }) || null;
4978
3883
  };
4979
3884
  return RangeValidatorMagicDirective;
4980
3885
  }());
4981
- /** @nocollapse */ RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
4982
- /** @nocollapse */ RangeValidatorMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
3886
+ RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
3887
+ RangeValidatorMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
4983
3888
  {
4984
3889
  provide: forms.NG_VALIDATORS,
4985
3890
  useExisting: RangeValidatorMagicDirective,
4986
3891
  multi: true,
4987
3892
  }
4988
3893
  ])] });
4989
- /*@__PURE__*/ (function () {
3894
+ (function () {
4990
3895
  i0.ɵsetClassMetadata(RangeValidatorMagicDirective, [{
4991
3896
  type: i0.Directive,
4992
3897
  args: [{
@@ -5011,36 +3916,20 @@
5011
3916
  i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
5012
3917
  }
5013
3918
  }
5014
- /**
5015
- * Represents a Magic subform
5016
- */
5017
3919
  var SubformMagicComponent = /** @class */ (function () {
5018
- /**
5019
- * @ignore
5020
- */
5021
3920
  function SubformMagicComponent(vcRef, mgSub) {
5022
3921
  this.vcRef = vcRef;
5023
3922
  this.mgSub = mgSub;
5024
- /**
5025
- * @ignore
5026
- */
5027
3923
  this.component = null;
5028
- // For angular 10 - find the component from views
5029
3924
  this.component = (this.vcRef._hostView).find(function (v) { return !util.isNullOrUndefined(v); });
5030
3925
  }
5031
3926
  Object.defineProperty(SubformMagicComponent.prototype, "magic", {
5032
- /**
5033
- * @ignore
5034
- */
5035
3927
  set: function (val) { this.id = val; },
5036
3928
  enumerable: false,
5037
3929
  configurable: true
5038
3930
  });
5039
3931
  ;
5040
3932
  Object.defineProperty(SubformMagicComponent.prototype, "Component", {
5041
- /**
5042
- * @ignore
5043
- */
5044
3933
  get: function () {
5045
3934
  return this.mgSub.mgGetComp(this.id);
5046
3935
  },
@@ -5048,9 +3937,6 @@
5048
3937
  configurable: true
5049
3938
  });
5050
3939
  Object.defineProperty(SubformMagicComponent.prototype, "Parameters", {
5051
- /**
5052
- * @ignore
5053
- */
5054
3940
  get: function () {
5055
3941
  return this.mgSub.mgGetParameters(this.id);
5056
3942
  },
@@ -5059,8 +3945,8 @@
5059
3945
  });
5060
3946
  return SubformMagicComponent;
5061
3947
  }());
5062
- /** @nocollapse */ SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
5063
- /** @nocollapse */ SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) {
3948
+ SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
3949
+ SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) {
5064
3950
  if (rf & 1) {
5065
3951
  i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
5066
3952
  }
@@ -5068,7 +3954,7 @@
5068
3954
  i0.ɵɵproperty("ngIf", ctx.Component);
5069
3955
  }
5070
3956
  }, directives: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
5071
- /*@__PURE__*/ (function () {
3957
+ (function () {
5072
3958
  i0.ɵsetClassMetadata(SubformMagicComponent, [{
5073
3959
  type: i0.Component,
5074
3960
  args: [{
@@ -5110,25 +3996,15 @@
5110
3996
  }
5111
3997
  }
5112
3998
  var _c1$1 = ["*"];
5113
- /**
5114
- * Represents a Magic subform
5115
- */
5116
3999
  var ErrorMagicComponent = /** @class */ (function () {
5117
- /**
5118
- * @ignore
5119
- */
5120
4000
  function ErrorMagicComponent(_task, mgService, changeDetectorRef) {
5121
4001
  this._task = _task;
5122
4002
  this.mgService = mgService;
5123
4003
  this.changeDetectorRef = changeDetectorRef;
5124
- // if true - display standard magic error message, if false - customer has provides his own content and we'll use it
5125
4004
  this.defaultDisplay = true;
5126
4005
  this.rowId = "0";
5127
4006
  }
5128
4007
  Object.defineProperty(ErrorMagicComponent.prototype, "magic", {
5129
- /**
5130
- * @ignore
5131
- */
5132
4008
  set: function (val) {
5133
4009
  this.id = val;
5134
4010
  },
@@ -5153,10 +4029,6 @@
5153
4029
  configurable: true
5154
4030
  });
5155
4031
  ;
5156
- /**
5157
- * returns true if the html element has no children
5158
- * @param element
5159
- */
5160
4032
  ErrorMagicComponent.prototype.isEmpty = function (element) {
5161
4033
  var nodes = element.childNodes;
5162
4034
  for (var i = 0; i < nodes.length; i++) {
@@ -5167,9 +4039,6 @@
5167
4039
  }
5168
4040
  return true;
5169
4041
  };
5170
- /**
5171
- * @ignore
5172
- */
5173
4042
  ErrorMagicComponent.prototype.HasErrors = function (id) {
5174
4043
  var e_1, _a;
5175
4044
  if (!util.isUndefined(id)) {
@@ -5203,8 +4072,8 @@
5203
4072
  };
5204
4073
  return ErrorMagicComponent;
5205
4074
  }());
5206
- /** @nocollapse */ ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
5207
- /** @nocollapse */ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) {
4075
+ ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
4076
+ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) {
5208
4077
  if (rf & 1) {
5209
4078
  i0.ɵɵviewQuery(_c0$2, true);
5210
4079
  }
@@ -5221,7 +4090,7 @@
5221
4090
  i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
5222
4091
  }
5223
4092
  }, directives: [i1.NgIf], encapsulation: 2 });
5224
- /*@__PURE__*/ (function () {
4093
+ (function () {
5225
4094
  i0.ɵsetClassMetadata(ErrorMagicComponent, [{
5226
4095
  type: i0.Component,
5227
4096
  args: [{
@@ -5240,31 +4109,22 @@
5240
4109
  }] });
5241
4110
  })();
5242
4111
 
5243
- /**
5244
- * Directive for checkboxes, to handle the 'change' event
5245
- */
5246
4112
  var CheckboxMagicDirective = /** @class */ (function () {
5247
- /**
5248
- * @ignore
5249
- */
5250
4113
  function CheckboxMagicDirective(magicDirective) {
5251
4114
  this.magicDirective = magicDirective;
5252
4115
  }
5253
- /**
5254
- * Handles the Checkbox 'change' event - pass it to the Magic engine
5255
- */
5256
4116
  CheckboxMagicDirective.prototype.onChange = function ($event) {
5257
4117
  this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
5258
4118
  };
5259
4119
  return CheckboxMagicDirective;
5260
4120
  }());
5261
- /** @nocollapse */ CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
5262
- /** @nocollapse */ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) {
4121
+ CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
4122
+ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) {
5263
4123
  if (rf & 1) {
5264
4124
  i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5265
4125
  }
5266
4126
  } });
5267
- /*@__PURE__*/ (function () {
4127
+ (function () {
5268
4128
  i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
5269
4129
  type: i0.Directive,
5270
4130
  args: [{
@@ -5276,28 +4136,22 @@
5276
4136
  }] });
5277
4137
  })();
5278
4138
 
5279
- /**
5280
- * Directive for comboboxes, to handle the 'change' event
5281
- */
5282
4139
  var ComboboxMagicDirective = /** @class */ (function () {
5283
4140
  function ComboboxMagicDirective(magicDirective) {
5284
4141
  this.magicDirective = magicDirective;
5285
4142
  }
5286
- /**
5287
- * Handles the Combobox 'change' event - pass it to the Magic engine
5288
- */
5289
4143
  ComboboxMagicDirective.prototype.onChange = function ($event) {
5290
4144
  this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
5291
4145
  };
5292
4146
  return ComboboxMagicDirective;
5293
4147
  }());
5294
- /** @nocollapse */ ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
5295
- /** @nocollapse */ ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) {
4148
+ ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
4149
+ ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) {
5296
4150
  if (rf & 1) {
5297
4151
  i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5298
4152
  }
5299
4153
  } });
5300
- /*@__PURE__*/ (function () {
4154
+ (function () {
5301
4155
  i0.ɵsetClassMetadata(ComboboxMagicDirective, [{
5302
4156
  type: i0.Directive,
5303
4157
  args: [{
@@ -5309,23 +4163,17 @@
5309
4163
  }] });
5310
4164
  })();
5311
4165
 
5312
- /**
5313
- * This service supports custom actions on magic exit
5314
- */
5315
4166
  var ExitMagicService = /** @class */ (function () {
5316
4167
  function ExitMagicService() {
5317
4168
  }
5318
- /**
5319
- * Override this method to implement custom logic on magic exit
5320
- */
5321
4169
  ExitMagicService.prototype.exitMagic = function () {
5322
4170
  console.log("Magic application terminated");
5323
4171
  };
5324
4172
  return ExitMagicService;
5325
4173
  }());
5326
- /** @nocollapse */ ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
5327
- /** @nocollapse */ ExitMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
5328
- /*@__PURE__*/ (function () {
4174
+ ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
4175
+ ExitMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
4176
+ (function () {
5329
4177
  i0.ɵsetClassMetadata(ExitMagicService, [{
5330
4178
  type: i0.Injectable
5331
4179
  }], null, null);
@@ -5359,19 +4207,7 @@
5359
4207
  i0.ɵɵelement(0, "div", 9);
5360
4208
  }
5361
4209
  }
5362
- /**
5363
- * Root Magic component
5364
- */
5365
4210
  var MagicShellComponent = /** @class */ (function () {
5366
- /**
5367
- *
5368
- * @param magic Magic's service
5369
- * @param componentList Magic component list
5370
- * @param changeDetectorRef Changes detector
5371
- * @param titleService Title setting service
5372
- * @param httpClient The native httpClient instance
5373
- * @param exitMagicService Magic exit service
5374
- */
5375
4211
  function MagicShellComponent(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
5376
4212
  this.engineMagicService = engineMagicService;
5377
4213
  this.componentList = componentList;
@@ -5381,32 +4217,22 @@
5381
4217
  this.httpClient = httpClient;
5382
4218
  this.pendingCommandsCollector = pendingCommandsCollector;
5383
4219
  this.exitMagicService = exitMagicService;
5384
- /**
5385
- * Root component to be displayed in the window
5386
- */
5387
4220
  this.RootComponent = null;
5388
4221
  this.magicEngineTerminated = false;
5389
4222
  this.initialize();
5390
4223
  this.setTitle();
5391
4224
  }
5392
- /**
5393
- * Before-unload event listener
5394
- * @param event
5395
- */
5396
4225
  MagicShellComponent.prototype.onBeforeUnload = function (event) {
5397
4226
  if (this.engineMagicService.TransCacheExists()) {
5398
- // Show the confirmation box before unloading the browser
5399
4227
  event.returnValue = 'Are you sure?';
5400
4228
  return 'Are you sure?';
5401
4229
  }
5402
4230
  else {
5403
- // terminate the magic server context using fetch API with keep-alive
5404
4231
  this.engineMagicService.TerminateContextUsingFetchAPI();
5405
4232
  this.magicEngineTerminated = true;
5406
4233
  }
5407
4234
  };
5408
4235
  MagicShellComponent.prototype.onUnload = function (event) {
5409
- // Chrome provides an opportunity to terminate the context after user approves the browser unload alert
5410
4236
  if (!this.magicEngineTerminated)
5411
4237
  this.engineMagicService.TerminateContextUsingFetchAPI();
5412
4238
  };
@@ -5417,26 +4243,13 @@
5417
4243
  MagicShellComponent.prototype.setViewContainerRef = function (vcRef) {
5418
4244
  this.overlayWindowsContainerViewRef = vcRef;
5419
4245
  };
5420
- /**
5421
- * Initialization of Magic mechanisms
5422
- */
5423
4246
  MagicShellComponent.prototype.initialize = function () {
5424
4247
  this.registerUICommands();
5425
4248
  };
5426
- /**
5427
- * Set the title
5428
- */
5429
4249
  MagicShellComponent.prototype.setTitle = function () {
5430
4250
  var newTitle = this.componentList.title;
5431
4251
  this.titleService.setTitle(newTitle);
5432
4252
  };
5433
- /**
5434
- * Set the component according to requested form
5435
- * @param formName Name of the form to open
5436
- * @param taskId Id of opening task
5437
- * @param taskDescription TODO
5438
- * @param isModal whether modal window is being opened
5439
- */
5440
4253
  MagicShellComponent.prototype.setComponent = function (formName, taskId, taskDescription, isModal) {
5441
4254
  this.pendingCommandsCollector.startCollecting();
5442
4255
  if (isModal) {
@@ -5448,9 +4261,6 @@
5448
4261
  }
5449
4262
  this.changeDetectorRef.detectChanges();
5450
4263
  };
5451
- /**
5452
- * @ignore
5453
- */
5454
4264
  MagicShellComponent.prototype.registerUICommands = function () {
5455
4265
  var _this = this;
5456
4266
  this.engineMagicService.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === '0'; }))
@@ -5463,10 +4273,6 @@
5463
4273
  GuiInteractiveExecutor.executeInteractiveCommand(null, command, _this.overlayWindowService);
5464
4274
  });
5465
4275
  };
5466
- /**
5467
- * Execute commands received from the Magic WebClient engine
5468
- * @param command
5469
- */
5470
4276
  MagicShellComponent.prototype.executeCommand = function (command) {
5471
4277
  switch (command.CommandType) {
5472
4278
  case gui.CommandType.OPEN_FORM:
@@ -5481,7 +4287,7 @@
5481
4287
  this.RootComponentParameters = {};
5482
4288
  this.changeDetectorRef.detectChanges();
5483
4289
  }
5484
- else { // Close modal window
4290
+ else {
5485
4291
  this.overlayWindowService.close(command.str);
5486
4292
  this.changeDetectorRef.detectChanges();
5487
4293
  }
@@ -5499,12 +4305,15 @@
5499
4305
  if (this.exitMagicService)
5500
4306
  this.exitMagicService.exitMagic();
5501
4307
  break;
4308
+ case gui.CommandType.SHOW_HTML_ERROR:
4309
+ window.document.write(command.str);
4310
+ break;
5502
4311
  }
5503
4312
  };
5504
4313
  return MagicShellComponent;
5505
4314
  }());
5506
- /** @nocollapse */ MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i5.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
5507
- /** @nocollapse */ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) {
4315
+ MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i5.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
4316
+ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) {
5508
4317
  if (rf & 1) {
5509
4318
  i0.ɵɵstaticViewQuery(_c0$3, true);
5510
4319
  }
@@ -5516,9 +4325,7 @@
5516
4325
  if (rf & 1) {
5517
4326
  i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, i0.ɵɵresolveWindow);
5518
4327
  }
5519
- }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([
5520
- // ExitMagicService
5521
- ])], 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) {
4328
+ }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵ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) {
5522
4329
  if (rf & 1) {
5523
4330
  i0.ɵɵelementStart(0, "div", null, 0);
5524
4331
  i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
@@ -5534,14 +4341,12 @@
5534
4341
  i0.ɵɵproperty("ngIf", ctx.showSpinner);
5535
4342
  }
5536
4343
  }, directives: [i1.NgIf, MagicViewContainerRef, i3.DynamicComponent, i3.DynamicIoDirective, i1.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 }"] });
5537
- /*@__PURE__*/ (function () {
4344
+ (function () {
5538
4345
  i0.ɵsetClassMetadata(MagicShellComponent, [{
5539
4346
  type: i0.Component,
5540
4347
  args: [{
5541
4348
  selector: 'magic-root',
5542
- providers: [
5543
- // ExitMagicService
5544
- ],
4349
+ providers: [],
5545
4350
  template: "\n <div #magicRoot>\n <ndc-dynamic\n *ngIf = \"RootComponent !== null\"\n [ndcDynamicComponent]=\"RootComponent\"\n [ndcDynamicInputs] =\"RootComponentParameters\">\n </ndc-dynamic>\n\n <div #overlayWindowsContainer magicViewContainerRef>\n </div>\n </div>\n\n <div class=\"spinner-background\" *ngIf=\"showSpinner\">\n <ng-container [ngTemplateOutlet]=\"SpinnerTemplate ? SpinnerTemplate:defaultSpinner\"></ng-container>\n </div>\n\n <ng-template #defaultSpinner>\n <div class=\"mgSpinnerClass\"></div>\n </ng-template>\n ",
5546
4351
  styles: ["\n .mgSpinnerClass {\n border: 10px solid #cccccc; /* Light grey */\n border-top: 10px solid black; /* Blue */\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 {\n /* background fixed across whole screen */\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 }\n "]
5547
4352
  }]
@@ -5563,17 +4368,11 @@
5563
4368
  }] });
5564
4369
  })();
5565
4370
 
5566
- /**
5567
- * @ignore
5568
- */
5569
4371
  var CHECKBOX_VALUE_ACCESSOR = {
5570
4372
  provide: forms.NG_VALUE_ACCESSOR,
5571
4373
  useExisting: i0.forwardRef(function () { return MagicCheckboxControlValueAccessor; }),
5572
4374
  multi: true,
5573
4375
  };
5574
- /**
5575
- * Value accessor for Checkbox without a FormControl
5576
- */
5577
4376
  var MagicCheckboxControlValueAccessor = /** @class */ (function (_super) {
5578
4377
  __extends(MagicCheckboxControlValueAccessor, _super);
5579
4378
  function MagicCheckboxControlValueAccessor() {
@@ -5581,14 +4380,14 @@
5581
4380
  }
5582
4381
  return MagicCheckboxControlValueAccessor;
5583
4382
  }(forms.CheckboxControlValueAccessor));
5584
- /** @nocollapse */ MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
5585
- /** @nocollapse */ MagicCheckboxControlValueAccessor.ɵdir = i0.ɵɵ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) {
4383
+ MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
4384
+ MagicCheckboxControlValueAccessor.ɵdir = i0.ɵɵ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) {
5586
4385
  if (rf & 1) {
5587
4386
  i0.ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
5588
4387
  }
5589
4388
  }, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
5590
- var ɵMagicCheckboxControlValueAccessor_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
5591
- /*@__PURE__*/ (function () {
4389
+ var ɵMagicCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
4390
+ (function () {
5592
4391
  i0.ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
5593
4392
  type: i0.Directive,
5594
4393
  args: [{
@@ -5599,17 +4398,11 @@
5599
4398
  }], null, null);
5600
4399
  })();
5601
4400
 
5602
- /**
5603
- * @ignore
5604
- */
5605
4401
  var MAGIC_DEFAULT_VALUE_ACCESSOR = {
5606
4402
  provide: forms.NG_VALUE_ACCESSOR,
5607
4403
  useExisting: i0.forwardRef(function () { return MagicDefaultValueAccessor; }),
5608
4404
  multi: true
5609
4405
  };
5610
- /**
5611
- * @ignore
5612
- */
5613
4406
  var MagicDefaultValueAccessor = /** @class */ (function (_super) {
5614
4407
  __extends(MagicDefaultValueAccessor, _super);
5615
4408
  function MagicDefaultValueAccessor() {
@@ -5617,14 +4410,14 @@
5617
4410
  }
5618
4411
  return MagicDefaultValueAccessor;
5619
4412
  }(forms.DefaultValueAccessor));
5620
- /** @nocollapse */ MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
5621
- /** @nocollapse */ MagicDefaultValueAccessor.ɵdir = i0.ɵɵ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) {
4413
+ MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
4414
+ MagicDefaultValueAccessor.ɵdir = i0.ɵɵ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) {
5622
4415
  if (rf & 1) {
5623
4416
  i0.ɵɵ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); });
5624
4417
  }
5625
4418
  }, exportAs: ["magic"], features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
5626
- var ɵMagicDefaultValueAccessor_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
5627
- /*@__PURE__*/ (function () {
4419
+ var ɵMagicDefaultValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
4420
+ (function () {
5628
4421
  i0.ɵsetClassMetadata(MagicDefaultValueAccessor, [{
5629
4422
  type: i0.Directive,
5630
4423
  args: [{
@@ -5641,28 +4434,22 @@
5641
4434
  }], null, null);
5642
4435
  })();
5643
4436
 
5644
- /**
5645
- * Directive for checkboxes which should not have a form control
5646
- */
5647
4437
  var CheckboxNoFormControlMagicDirective = /** @class */ (function () {
5648
4438
  function CheckboxNoFormControlMagicDirective(magicDirective) {
5649
4439
  this.magicDirective = magicDirective;
5650
4440
  }
5651
- /**
5652
- * Handle the 'Checkbox' change event - pass it to the Magic engine
5653
- */
5654
4441
  CheckboxNoFormControlMagicDirective.prototype.onChange = function ($event) {
5655
4442
  this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
5656
4443
  };
5657
4444
  return CheckboxNoFormControlMagicDirective;
5658
4445
  }());
5659
- /** @nocollapse */ CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
5660
- /** @nocollapse */ CheckboxNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) {
4446
+ CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
4447
+ CheckboxNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) {
5661
4448
  if (rf & 1) {
5662
4449
  i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5663
4450
  }
5664
4451
  } });
5665
- /*@__PURE__*/ (function () {
4452
+ (function () {
5666
4453
  i0.ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
5667
4454
  type: i0.Directive,
5668
4455
  args: [{
@@ -5674,28 +4461,22 @@
5674
4461
  }] });
5675
4462
  })();
5676
4463
 
5677
- /**
5678
- * Directive for non-checkbox input controls which do not have a form control
5679
- */
5680
4464
  var InputNoFormControlMagicDirective = /** @class */ (function () {
5681
4465
  function InputNoFormControlMagicDirective(magicDirective) {
5682
4466
  this.magicDirective = magicDirective;
5683
4467
  }
5684
- /**
5685
- * Handles the 'change' event - pass it to the Magic engine
5686
- */
5687
4468
  InputNoFormControlMagicDirective.prototype.onChange = function ($event) {
5688
4469
  this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
5689
4470
  };
5690
4471
  return InputNoFormControlMagicDirective;
5691
4472
  }());
5692
- /** @nocollapse */ InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
5693
- /** @nocollapse */ InputNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) {
4473
+ InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
4474
+ InputNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) {
5694
4475
  if (rf & 1) {
5695
4476
  i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5696
4477
  }
5697
4478
  } });
5698
- /*@__PURE__*/ (function () {
4479
+ (function () {
5699
4480
  i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
5700
4481
  type: i0.Directive,
5701
4482
  args: [{
@@ -5712,14 +4493,6 @@
5712
4493
  useExisting: i0.forwardRef(function () { return DateValueAccessor; }),
5713
4494
  multi: true
5714
4495
  };
5715
- /**
5716
- * The accessor for writing a value and listening to changes on a date input element
5717
- *
5718
- * ### Example
5719
- * `<input type="date" name="birthday" ngModel dateInput>`
5720
- * OR
5721
- * `<input type="date" formControlName="birthday" dateInput>`
5722
- */
5723
4496
  var DateValueAccessor = /** @class */ (function () {
5724
4497
  function DateValueAccessor(renderer, elementRef) {
5725
4498
  this.renderer = renderer;
@@ -5727,7 +4500,6 @@
5727
4500
  this.onChange = function (_) { };
5728
4501
  this.onTouched = function () { };
5729
4502
  }
5730
- /** Writes a new value to the element (model -> view) */
5731
4503
  DateValueAccessor.prototype.writeValue = function (value) {
5732
4504
  if (!value) {
5733
4505
  this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
@@ -5735,29 +4507,26 @@
5735
4507
  }
5736
4508
  this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
5737
4509
  };
5738
- /** Registers a callback function, called when value changes (view -> model) */
5739
4510
  DateValueAccessor.prototype.registerOnChange = function (fn) {
5740
4511
  this.onChange = function (v) { return fn(v instanceof Date
5741
4512
  ? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
5742
4513
  : v); };
5743
4514
  };
5744
- /** Registers a callback function, called when the control is blurred */
5745
4515
  DateValueAccessor.prototype.registerOnTouched = function (fn) {
5746
4516
  this.onTouched = fn;
5747
4517
  };
5748
- /** Enables or disables the element when the control status changes */
5749
4518
  DateValueAccessor.prototype.setDisabledState = function (isDisabled) {
5750
4519
  this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
5751
4520
  };
5752
4521
  return DateValueAccessor;
5753
4522
  }());
5754
- /** @nocollapse */ DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
5755
- /** @nocollapse */ DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) {
4523
+ DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
4524
+ DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) {
5756
4525
  if (rf & 1) {
5757
4526
  i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
5758
4527
  }
5759
4528
  }, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
5760
- /*@__PURE__*/ (function () {
4529
+ (function () {
5761
4530
  i0.ɵsetClassMetadata(DateValueAccessor, [{
5762
4531
  type: i0.Directive,
5763
4532
  args: [{
@@ -5773,25 +4542,12 @@
5773
4542
  }] });
5774
4543
  })();
5775
4544
 
5776
- /**
5777
- * 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
5778
- */
5779
4545
  var NonMagicControlDirective = /** @class */ (function () {
5780
- /**
5781
- *
5782
- * @param _task The task service
5783
- * @param element The element for which the directive is applied
5784
- * @param renderer Renderer for the element
5785
- * @param vcRef
5786
- */
5787
4546
  function NonMagicControlDirective(_task, element, renderer, vcRef) {
5788
4547
  this._task = _task;
5789
4548
  this.element = element;
5790
4549
  this.renderer = renderer;
5791
4550
  this.vcRef = vcRef;
5792
- /**
5793
- * Collection of event handlers for this element
5794
- */
5795
4551
  this.eventHandlers = {};
5796
4552
  this.eventsOnlyVal = false;
5797
4553
  this.htmlElement = this.element.nativeElement;
@@ -5806,45 +4562,31 @@
5806
4562
  });
5807
4563
  ;
5808
4564
  Object.defineProperty(NonMagicControlDirective.prototype, "task", {
5809
- /**
5810
- * Get the task service
5811
- * @returns
5812
- */
5813
4565
  get: function () {
5814
4566
  return this._task;
5815
4567
  },
5816
4568
  enumerable: false,
5817
4569
  configurable: true
5818
4570
  });
5819
- /**
5820
- * Register to the events this element may need to handle
5821
- */
5822
4571
  NonMagicControlDirective.prototype.regEvents = function () {
5823
4572
  var _this = this;
5824
- // Handle events for which event handler may be removed and restored
5825
4573
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
5826
4574
  Object.keys(this.eventHandlers).forEach(function (key) {
5827
4575
  _this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
5828
4576
  });
5829
4577
  };
5830
- /**
5831
- * Handle focus event
5832
- */
5833
4578
  NonMagicControlDirective.prototype.OnFocus = function () {
5834
4579
  this.task.insertEvent(engine.getGuiEventObj('focusOnNonMagicControl', "", -1));
5835
4580
  event.cancelBubble = true;
5836
4581
  };
5837
- /**
5838
- * Initialize this object
5839
- */
5840
4582
  NonMagicControlDirective.prototype.ngOnInit = function () {
5841
4583
  this.regEvents();
5842
4584
  };
5843
4585
  return NonMagicControlDirective;
5844
4586
  }());
5845
- /** @nocollapse */ NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
5846
- /** @nocollapse */ NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
5847
- /*@__PURE__*/ (function () {
4587
+ NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
4588
+ NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
4589
+ (function () {
5848
4590
  i0.ɵsetClassMetadata(NonMagicControlDirective, [{
5849
4591
  type: i0.Directive,
5850
4592
  args: [{
@@ -5856,9 +4598,6 @@
5856
4598
  }] });
5857
4599
  })();
5858
4600
 
5859
- /**
5860
- * @ignore
5861
- */
5862
4601
  var decs = [
5863
4602
  MagicDirective,
5864
4603
  CheckboxMagicDirective,
@@ -5889,9 +4628,6 @@
5889
4628
  MagicFocusDirective,
5890
4629
  MagicViewContainerRef
5891
4630
  ];
5892
- /**
5893
- * @ignore
5894
- */
5895
4631
  var MagicModule = /** @class */ (function () {
5896
4632
  function MagicModule() {
5897
4633
  }
@@ -5909,12 +4645,11 @@
5909
4645
  };
5910
4646
  return MagicModule;
5911
4647
  }());
5912
- /** @nocollapse */ MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
5913
- /** @nocollapse */ MagicModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
4648
+ MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
4649
+ MagicModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
5914
4650
  i1.CommonModule,
5915
4651
  forms.FormsModule,
5916
4652
  forms.ReactiveFormsModule,
5917
- //ThemeModule,
5918
4653
  i2.RouterModule,
5919
4654
  i3.DynamicModule,
5920
4655
  i5.HttpClientModule
@@ -5950,7 +4685,6 @@
5950
4685
  MagicViewContainerRef], imports: [i1.CommonModule,
5951
4686
  forms.FormsModule,
5952
4687
  forms.ReactiveFormsModule,
5953
- //ThemeModule,
5954
4688
  i2.RouterModule,
5955
4689
  i3.DynamicModule,
5956
4690
  i5.HttpClientModule], exports: [MagicDirective,
@@ -5982,7 +4716,7 @@
5982
4716
  MagicFocusDirective,
5983
4717
  MagicViewContainerRef] });
5984
4718
  })();
5985
- /*@__PURE__*/ (function () {
4719
+ (function () {
5986
4720
  i0.ɵsetClassMetadata(MagicModule, [{
5987
4721
  type: i0.NgModule,
5988
4722
  args: [{
@@ -5993,12 +4727,10 @@
5993
4727
  i1.CommonModule,
5994
4728
  forms.FormsModule,
5995
4729
  forms.ReactiveFormsModule,
5996
- //ThemeModule,
5997
4730
  i2.RouterModule,
5998
4731
  i3.DynamicModule,
5999
4732
  i5.HttpClientModule
6000
4733
  ],
6001
- //Customizable providers
6002
4734
  providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
6003
4735
  }]
6004
4736
  }], null, null);
@@ -6089,7 +4821,7 @@
6089
4821
  this.mgdtfmt = this.task.mgInputDateFormat;
6090
4822
  if (displayFormat === 'input') {
6091
4823
  if (this.mgdtfmt == null)
6092
- this.mgdtfmt = 'M/d/yyyy'; //default format
4824
+ this.mgdtfmt = 'M/d/yyyy';
6093
4825
  return i1.formatDate(date, this.mgdtfmt, this.locale);
6094
4826
  }
6095
4827
  else {
@@ -6098,9 +4830,9 @@
6098
4830
  };
6099
4831
  return MgDateAdapter;
6100
4832
  }(core.NativeDateAdapter));
6101
- /** @nocollapse */ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$2.Platform), i0.ɵɵinject(TaskMagicService)); };
6102
- /** @nocollapse */ MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
6103
- /*@__PURE__*/ (function () {
4833
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$2.Platform), i0.ɵɵinject(TaskMagicService)); };
4834
+ MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4835
+ (function () {
6104
4836
  i0.ɵsetClassMetadata(MgDateAdapter, [{
6105
4837
  type: i0.Injectable
6106
4838
  }], function () { return [{ type: i1$2.Platform }, { type: TaskMagicService }]; }, null);
@@ -6110,9 +4842,6 @@
6110
4842
  { provide: core.DateAdapter, useClass: MgDateAdapter },
6111
4843
  { provide: core.MAT_DATE_FORMATS, useValue: MG_FORMATS }
6112
4844
  ];
6113
- /**
6114
- * Magic service providers
6115
- */
6116
4845
  var basicMagicProviders = [
6117
4846
  MagicServices,
6118
4847
  TaskMagicService,
@@ -6125,20 +4854,9 @@
6125
4854
  TableMagicService
6126
4855
  ]);
6127
4856
 
6128
- /**
6129
- * @ignore
6130
- */
6131
- ///////////////////////////////////////////////////////////
6132
- // class to hold gui-related helper methods
6133
- ///////////////////////////////////////////////////////////
6134
4857
  var utils = /** @class */ (function () {
6135
4858
  function utils() {
6136
4859
  }
6137
- ///////////////////////////////////////////////////////////
6138
- // Add magic child control to the supplied array.
6139
- // Recursive, and checks children even if they are not magic controls.
6140
- // Magic controls are controls which have a magic directive attached to them.
6141
- ///////////////////////////////////////////////////////////
6142
4860
  utils.addChildren = function (parent, children, selector) {
6143
4861
  for (var i = 0; i < parent.children.length; i++) {
6144
4862
  if (typeof parent.children[i].attributes[selector] !== "undefined") {
@@ -6147,9 +4865,6 @@
6147
4865
  this.addChildren(parent.children[i], children, selector);
6148
4866
  }
6149
4867
  };
6150
- ///////////////////////////////////////////////////////////
6151
- // Calculate the distance between the control and the supplied x,y coordinates
6152
- ///////////////////////////////////////////////////////////
6153
4868
  utils.getDistance = function (control, x, y) {
6154
4869
  var left = control.clientLeft, top = control.clientTop;
6155
4870
  var dx, dy;
@@ -6176,9 +4891,6 @@
6176
4891
  var ret = (dx * dx + dy * dy);
6177
4892
  return ret;
6178
4893
  };
6179
- ///////////////////////////////////////////////////////////
6180
- //
6181
- ///////////////////////////////////////////////////////////
6182
4894
  utils.getDimentions = function (el) {
6183
4895
  var xPos = 0;
6184
4896
  var yPos = 0;
@@ -6186,14 +4898,12 @@
6186
4898
  var height = el.height;
6187
4899
  while (el) {
6188
4900
  if (el.tagName == "BODY") {
6189
- // deal with browser quirks with body/window/document and page scroll
6190
4901
  var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
6191
4902
  var yScroll = el.scrollTop || document.documentElement.scrollTop;
6192
4903
  xPos += (el.offsetLeft - xScroll + el.clientLeft);
6193
4904
  yPos += (el.offsetTop - yScroll + el.clientTop);
6194
4905
  }
6195
4906
  else {
6196
- // for all other non-BODY elements
6197
4907
  xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
6198
4908
  yPos += (el.offsetTop - el.scrollTop + el.clientTop);
6199
4909
  }
@@ -6209,9 +4919,6 @@
6209
4919
  return utils;
6210
4920
  }());
6211
4921
 
6212
- /**
6213
- * @ignore
6214
- */
6215
4922
  var ModalFormDefinition = /** @class */ (function () {
6216
4923
  function ModalFormDefinition() {
6217
4924
  this.taskId = "";
@@ -6221,10 +4928,6 @@
6221
4928
  return ModalFormDefinition;
6222
4929
  }());
6223
4930
 
6224
- /**
6225
- * Generated bundle index. Do not edit.
6226
- */
6227
-
6228
4931
  exports.AccessorMagicService = AccessorMagicService;
6229
4932
  exports.BaseMagicAlertComponent = BaseMagicAlertComponent;
6230
4933
  exports.BaseMagicConfirmComponent = BaseMagicConfirmComponent;