@magic-xpa/angular 4.900.0-dev490.73 → 4.900.0-dev490.76

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.
@@ -10,7 +10,7 @@ import * as i3 from 'ng-dynamic-component';
10
10
  import { DynamicModule } from 'ng-dynamic-component';
11
11
  import { InteractiveCommandType, OverlayType, Styles, HtmlProperties, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
12
12
  import { MagicBridge, getGuiEventObj, CookieService } from '@magic-xpa/engine';
13
- import { MagicProperties, Logger, StrUtil, StorageAttribute, BindingLevel, StorageAttributeType, PICInterface } from '@magic-xpa/utils';
13
+ import { MagicProperties, Logger, StrUtil, StorageAttribute, BindingLevel, StorageAttributeType, MgControlType, PICInterface } from '@magic-xpa/utils';
14
14
  import { filter, map, debounceTime } from 'rxjs/operators';
15
15
  import { Subject, fromEvent } from 'rxjs';
16
16
  import { __decorate, __metadata } from 'tslib';
@@ -2778,16 +2778,16 @@ class MagicDirective {
2778
2778
  this.eventHandlers = {};
2779
2779
  this.eventsOnlyVal = false;
2780
2780
  this.htmlElement = this.element.nativeElement;
2781
- if (!(typeof magicRow === 'undefined' || magicRow === null))
2781
+ if (!(typeof magicRow === "undefined" || magicRow === null))
2782
2782
  this.rowId = magicRow.rowId;
2783
2783
  }
2784
2784
  set magic(val) {
2785
2785
  this.id = val;
2786
- this.selector = 'magic';
2786
+ this.selector = "magic";
2787
2787
  }
2788
2788
  ;
2789
2789
  set eventsOnly(val) {
2790
- console.log('eventsOnly');
2790
+ console.log("eventsOnly");
2791
2791
  this.eventsOnlyVal = true;
2792
2792
  }
2793
2793
  ;
@@ -2795,11 +2795,11 @@ class MagicDirective {
2795
2795
  return this._task;
2796
2796
  }
2797
2797
  regEvents() {
2798
- this.eventHandlers['focusin'] = this.OnFocus.bind(this);
2798
+ this.eventHandlers["focusin"] = this.OnFocus.bind(this);
2799
2799
  Object.keys(this.eventHandlers).forEach((key) => {
2800
2800
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
2801
2801
  });
2802
- let events = ['click', 'mousedown', 'dblclick'];
2802
+ let events = ["click", "mousedown", "dblclick"];
2803
2803
  events.forEach(event => {
2804
2804
  this.renderer.listen(this.htmlElement, event, (e) => {
2805
2805
  let fromButton = false;
@@ -2810,15 +2810,15 @@ class MagicDirective {
2810
2810
  e.cancelBubble = true;
2811
2811
  });
2812
2812
  });
2813
- this.renderer.listen(this.htmlElement, 'change', (e) => {
2814
- let guiEvent = getGuiEventObj('selectionchanged', this.id, +this.rowId);
2813
+ this.renderer.listen(this.htmlElement, "change", (e) => {
2814
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, +this.rowId);
2815
2815
  if ((event.target).selectedIndex !== undefined) {
2816
2816
  guiEvent.Value = (event.target).selectedIndex.toString();
2817
2817
  e.cancelBubble = true;
2818
2818
  this.task.insertEvent(guiEvent);
2819
2819
  }
2820
2820
  });
2821
- fromEvent(this.htmlElement, 'input').pipe(map((event) => {
2821
+ fromEvent(this.htmlElement, "input").pipe(map((event) => {
2822
2822
  return event.target.value;
2823
2823
  }), debounceTime(200)).subscribe((x) => {
2824
2824
  if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
@@ -2827,8 +2827,8 @@ class MagicDirective {
2827
2827
  this.task.mgAccessorService.setValueToControl(this.id, x, true);
2828
2828
  }
2829
2829
  });
2830
- this.renderer.listen(this.htmlElement, 'keydown', (e) => {
2831
- let guiEvent = getGuiEventObj('keydown', this.id, +this.rowId);
2830
+ this.renderer.listen(this.htmlElement, "keydown", (e) => {
2831
+ let guiEvent = getGuiEventObj("keydown", this.id, +this.rowId);
2832
2832
  guiEvent.modifiers = Modifiers.MODIFIER_NONE;
2833
2833
  if (e.altKey && e.keyCode !== GuiConstants.KEY_ALT)
2834
2834
  guiEvent.modifiers = Modifiers.MODIFIER_ALT;
@@ -2854,7 +2854,7 @@ class MagicDirective {
2854
2854
  });
2855
2855
  }
2856
2856
  OnFocus() {
2857
- this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
2857
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
2858
2858
  event.cancelBubble = true;
2859
2859
  }
2860
2860
  IsSameElement(command) {
@@ -2874,7 +2874,7 @@ class MagicDirective {
2874
2874
  .subscribe(a => {
2875
2875
  let command = a;
2876
2876
  if (isNullOrUndefined(this.rowId))
2877
- this.rowId = '0';
2877
+ this.rowId = "0";
2878
2878
  try {
2879
2879
  if (!this.eventsOnlyVal)
2880
2880
  this.handleCommand(command);
@@ -2902,7 +2902,7 @@ class MagicDirective {
2902
2902
  this.focusUnlistener();
2903
2903
  if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
2904
2904
  this.htmlElement.focus();
2905
- this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
2905
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
2906
2906
  break;
2907
2907
  }
2908
2908
  }
@@ -2912,13 +2912,13 @@ class MagicDirective {
2912
2912
  let methodName = command._str;
2913
2913
  let args = command.arguments;
2914
2914
  let magicComponent = (this.vcRef._hostLView).find(v => v instanceof TaskBaseMagicComponent);
2915
- let resultString = '';
2915
+ let resultString = "";
2916
2916
  try {
2917
2917
  if (!isNullOrUndefined(magicComponent[methodName])) {
2918
2918
  resultString = magicComponent[methodName].apply(magicComponent, args);
2919
2919
  }
2920
2920
  else
2921
- console.error('Instance method ' + methodName + ' does not exists');
2921
+ console.error("Instance method " + methodName + " does not exists");
2922
2922
  }
2923
2923
  catch (e) {
2924
2924
  console.error(e.message);
@@ -2930,10 +2930,13 @@ class MagicDirective {
2930
2930
  handleSetProperty(command) {
2931
2931
  switch (command.Operation) {
2932
2932
  case HtmlProperties.ReadOnly:
2933
- if (command.obj1 != true)
2934
- this.renderer.removeAttribute(this.htmlElement, command.Operation);
2935
- else
2936
- this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
2933
+ {
2934
+ if (command.obj.Type == MgControlType.CTRL_TYPE_TEXT)
2935
+ if (command.obj1 != true)
2936
+ this.renderer.removeAttribute(this.htmlElement, command.Operation);
2937
+ else
2938
+ this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
2939
+ }
2937
2940
  break;
2938
2941
  }
2939
2942
  }
@@ -2948,16 +2951,16 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
2948
2951
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
2949
2952
  type: Directive,
2950
2953
  args: [{
2951
- selector: '[magic]'
2954
+ selector: "[magic]"
2952
2955
  }]
2953
2956
  }], function () { return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
2954
2957
  type: Optional
2955
2958
  }] }]; }, { magic: [{
2956
2959
  type: Input,
2957
- args: ['magic']
2960
+ args: ["magic"]
2958
2961
  }], eventsOnly: [{
2959
2962
  type: Input,
2960
- args: ['eventsOnly']
2963
+ args: ["eventsOnly"]
2961
2964
  }], rowId: [{
2962
2965
  type: Input
2963
2966
  }] }); })();