@magic-xpa/angular 4.801.0-dev481.292 → 4.801.0-dev481.299

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.
@@ -455,7 +455,7 @@ class SubformMagicService {
455
455
  return this.subformsDict[subformName].parameters;
456
456
  }
457
457
  else
458
- return "";
458
+ return '';
459
459
  }
460
460
  deleteSubformComp(subformControlName, formName) {
461
461
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
@@ -479,8 +479,8 @@ class SubformMagicService {
479
479
  if (moduleRef == null) {
480
480
  let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
481
481
  if (lazyLoadModule != null) {
482
- let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
483
- moduleName = moduleName.replace("Module", "");
482
+ let moduleName = lazyLoadModule.moduleName.replace('Magic', '');
483
+ moduleName = moduleName.replace('Module', '');
484
484
  this.loader.Load(moduleName).then(m => {
485
485
  const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
486
486
  moduleRef = compiled.ngModuleFactory.create(this.injector);
@@ -502,7 +502,7 @@ class SubformMagicService {
502
502
  }
503
503
  else {
504
504
  if (inDefaultOutlet)
505
- subformControlName = "primary";
505
+ subformControlName = 'primary';
506
506
  let routeParams = new List();
507
507
  routeParams.push(routerPath);
508
508
  if (params !== null) {
@@ -524,7 +524,6 @@ class SubformMagicService {
524
524
  this.task.refreshView();
525
525
  }
526
526
  ExecuteRouteCommand(routeCommand) {
527
- let reusingComponent = false;
528
527
  let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
529
528
  let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
530
529
  if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
@@ -583,7 +582,7 @@ class SubformMagicService {
583
582
  if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
584
583
  currentActiveRoute = currentActiveRoute.parent;
585
584
  if (!currentActiveRoute.snapshot.routeConfig.loadChildren)
586
- console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.");
585
+ console.log('getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.');
587
586
  }
588
587
  return currentActiveRoute;
589
588
  }
@@ -614,7 +613,6 @@ class RouterContainerMagicComponent {
614
613
  return RouterContainerMagicComponent.lastRoute;
615
614
  }
616
615
  ngOnInit() {
617
- let outletname = this.activatedRoute.outlet;
618
616
  let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
619
617
  let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
620
618
  RouterContainerMagicComponent.lastRoute = this.router.url;
@@ -802,21 +800,20 @@ BaseMagicOverlayContainer = __decorate([
802
800
  ], BaseMagicOverlayContainer);
803
801
 
804
802
  class MagicViewContainerRef {
805
- constructor(vcRef, resolver) {
803
+ constructor(vcRef) {
806
804
  this.vcRef = vcRef;
807
- this.resolver = resolver;
808
805
  let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
809
806
  comp.setViewContainerRef(vcRef);
810
807
  }
811
808
  }
812
- MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
809
+ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
813
810
  MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
814
811
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
815
812
  type: Directive,
816
813
  args: [{
817
814
  selector: '[magicViewContainerRef]',
818
815
  }]
819
- }], function () { return [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }]; }, null); })();
816
+ }], function () { return [{ type: i0.ViewContainerRef }]; }, null); })();
820
817
 
821
818
  const _c0$3 = ["modalheader"];
822
819
  const _c1$1 = ["modalForeground"];
@@ -842,9 +839,8 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
842
839
  i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
843
840
  } }
844
841
  class MagicOverlayContainer extends BaseMagicOverlayContainer {
845
- constructor(injector, componentFactoryResolver) {
842
+ constructor(componentFactoryResolver) {
846
843
  super();
847
- this.injector = injector;
848
844
  this.componentFactoryResolver = componentFactoryResolver;
849
845
  this.ModalComp = null;
850
846
  this.ModalCompParameters = {};
@@ -865,7 +861,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
865
861
  return comp.FormName();
866
862
  }
867
863
  else
868
- return "";
864
+ return '';
869
865
  }
870
866
  getStyle() {
871
867
  let styles = {};
@@ -874,11 +870,11 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
874
870
  styles['width'] = comp.Width();
875
871
  styles['height'] = comp.Height();
876
872
  if (comp.IsCenteredToWindow()) {
877
- styles['margin'] = "auto";
873
+ styles['margin'] = 'auto';
878
874
  }
879
875
  else {
880
- styles['margin-left'] = comp.X() + "px";
881
- styles['margin-top'] = comp.Y() + "px";
876
+ styles['margin-left'] = comp.X() + 'px';
877
+ styles['margin-top'] = comp.Y() + 'px';
882
878
  }
883
879
  }
884
880
  return styles;
@@ -886,15 +882,14 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
886
882
  getClientAreaStyles() {
887
883
  let styles = {};
888
884
  if (this.componentRef != undefined) {
889
- let comp = this.componentRef.instance;
890
885
  const headerHeight = this.getShowTitleBar() && !isNullOrUndefined(this.headerElementRef) ? (this.headerElementRef.nativeElement.offsetHeight + 1) : 0;
891
886
  if (!isNullOrUndefined(this.foregroundElementRef)) {
892
887
  const foregroundHeight = this.foregroundElementRef.nativeElement.offsetHeight;
893
- styles['height'] = (foregroundHeight - headerHeight) + "px";
888
+ styles['height'] = (foregroundHeight - headerHeight) + 'px';
894
889
  const foregroundWidth = this.foregroundElementRef.nativeElement.offsetWidth;
895
- styles['width'] = (foregroundWidth) + "px";
890
+ styles['width'] = (foregroundWidth) + 'px';
896
891
  }
897
- styles['overflow'] = "auto";
892
+ styles['overflow'] = 'auto';
898
893
  }
899
894
  return styles;
900
895
  }
@@ -913,7 +908,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
913
908
  this.OnClose();
914
909
  }
915
910
  }
916
- MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
911
+ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
917
912
  MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
918
913
  i0.ɵɵviewQuery(_c0$3, 5);
919
914
  i0.ɵɵviewQuery(_c1$1, 5);
@@ -963,7 +958,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
963
958
  </div>
964
959
  </div>
965
960
  `, styles: [".modal-foreground{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#fff}.modal-background{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
966
- }], function () { return [{ type: i0.Injector }, { type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
961
+ }], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
967
962
  type: ViewChild,
968
963
  args: ['modalheader', { static: false }]
969
964
  }], foregroundElementRef: [{
@@ -1370,7 +1365,6 @@ class confirmationBox {
1370
1365
  }
1371
1366
  static showConfirmationBox(title, message, style) {
1372
1367
  let okWasPressed = false;
1373
- let retValue = Styles.MSGBOX_RESULT_OK;
1374
1368
  let isConfirm = this.isConfirmBox(style);
1375
1369
  let titleAndString = title + '\n' + '\n' + message;
1376
1370
  if (isConfirm)
@@ -2258,6 +2252,8 @@ class MagicColorService {
2258
2252
  constructor(http) {
2259
2253
  this.http = http;
2260
2254
  this.colorFilePath = 'assets/clr_rnt.eng';
2255
+ }
2256
+ getColorData() {
2261
2257
  this.http.get(this.colorFilePath, { responseType: 'text' }).subscribe(resp => {
2262
2258
  this.colorsData = resp.replace(/\n/g, '@').split('@');
2263
2259
  });
@@ -2277,24 +2273,30 @@ class MagicColorService {
2277
2273
  return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
2278
2274
  }
2279
2275
  getColor(colorIndex, colorType) {
2280
- if (this.colorsData && this.colorsData[colorIndex]) {
2276
+ if (!this.colorsData)
2277
+ this.getColorData();
2278
+ if (this.colorsData && this.colorsData[colorIndex - 1]) {
2281
2279
  let hex = '';
2282
2280
  const grayHashCode = '00808080';
2283
2281
  let color = this.colorsData[colorIndex].split(',');
2284
2282
  if (+color[3] <= 1) {
2285
2283
  switch (colorType) {
2286
2284
  case MAGIC_FG_COLOR:
2287
- hex = ('#' + color[1]);
2285
+ hex = (color[1]);
2288
2286
  break;
2289
2287
  case MAGIC_BG_COLOR:
2290
- hex = ('#' + color[2]);
2288
+ hex = (color[2]);
2291
2289
  break;
2290
+ default:
2291
+ console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
2292
+ return '';
2292
2293
  }
2293
2294
  }
2294
2295
  else
2295
2296
  hex = grayHashCode;
2296
2297
  return this.hexToRgba('#' + hex);
2297
2298
  }
2299
+ console.log('Could not get color for number ' + colorIndex);
2298
2300
  return '';
2299
2301
  }
2300
2302
  }
@@ -2649,7 +2651,7 @@ class TaskBaseMagicComponent {
2649
2651
  return this.task.ScreenModeControls;
2650
2652
  }
2651
2653
  ngOnInit() {
2652
- let subscription = this.task.detectChanges.pipe().subscribe(c => {
2654
+ this.task.detectChanges.pipe().subscribe(c => {
2653
2655
  this.ref.detectChanges();
2654
2656
  });
2655
2657
  this.task.initTask(this.taskIdParam, this.taskDescription);
@@ -2958,7 +2960,6 @@ class NoControlMagicDirective extends MagicDirective {
2958
2960
  }
2959
2961
  if (this.isRadio()) {
2960
2962
  this.htmlElement.addEventListener('change', (e) => {
2961
- let result = this.task.getFormControl('0', this.id);
2962
2963
  let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
2963
2964
  guiEvent.Value = (e.target).value;
2964
2965
  this.task.insertEvent(guiEvent);
@@ -3313,7 +3314,7 @@ class MgformatMagicDirective {
3313
3314
  }
3314
3315
  }
3315
3316
  generatePattern(attribute, pic) {
3316
- let pattern = "";
3317
+ let pattern = '';
3317
3318
  switch (attribute) {
3318
3319
  case StorageAttribute.NUMERIC:
3319
3320
  pattern = this.generatePatternForNumber(pic);
@@ -3327,14 +3328,14 @@ class MgformatMagicDirective {
3327
3328
  }
3328
3329
  generatePatternForNumber(pic) {
3329
3330
  let patternStr = new StringBuilder();
3330
- patternStr.Append("^");
3331
+ patternStr.Append('^');
3331
3332
  if (pic.isNegative())
3332
- patternStr.Append("-?");
3333
+ patternStr.Append('-?');
3333
3334
  if (pic.getWholes())
3334
- patternStr.AppendFormat("\\d{{0},{1}}", 0, pic.getWholes());
3335
+ patternStr.AppendFormat('\\d{{0},{1}}', 0, pic.getWholes());
3335
3336
  if (pic.getDec())
3336
- patternStr.AppendFormat("(\\.\\d{1,{0}})?", pic.getDec());
3337
- patternStr.Append("$");
3337
+ patternStr.AppendFormat('(\\.\\d{1,{0}})?', pic.getDec());
3338
+ patternStr.Append('$');
3338
3339
  return patternStr.ToString();
3339
3340
  }
3340
3341
  isPatternGenerationNeeded(attr, pic) {
@@ -3350,15 +3351,13 @@ class MgformatMagicDirective {
3350
3351
  let cnt = 0;
3351
3352
  let inputAllChars = false;
3352
3353
  let closeSet = false;
3353
- let val = null;
3354
- let allowMulitiline = false;
3355
3354
  let mask = pic.getMask();
3356
3355
  let pattern = new StringBuilder();
3357
- pattern.Append("^");
3356
+ pattern.Append('^');
3358
3357
  for (let i = 0; i < mask.length;) {
3359
3358
  if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
3360
3359
  || mask.charCodeAt(i) == PICInterface.PIC_X)) {
3361
- pattern.Append("(");
3360
+ pattern.Append('(');
3362
3361
  closeSet = true;
3363
3362
  inputAllChars = false;
3364
3363
  }
@@ -3368,7 +3367,7 @@ class MgformatMagicDirective {
3368
3367
  case PICInterface.PIC_X:
3369
3368
  case PICInterface.PIC_L:
3370
3369
  {
3371
- pattern.Append(".");
3370
+ pattern.Append('.');
3372
3371
  let inputAllCharsRef = new RefParam(false);
3373
3372
  let dirs = PICInterface.PIC_U.toString();
3374
3373
  dirs += PICInterface.PIC_L.toString();
@@ -3380,7 +3379,7 @@ class MgformatMagicDirective {
3380
3379
  break;
3381
3380
  case PICInterface.PIC_N:
3382
3381
  {
3383
- pattern.Append("\\d");
3382
+ pattern.Append('\\d');
3384
3383
  let inputAllCharsRef = new RefParam(false);
3385
3384
  cnt = this.getDirectiveCount(mask, i, PICInterface.PIC_L.toString(), inputAllCharsRef);
3386
3385
  inputAllChars = inputAllCharsRef.value;
@@ -3393,12 +3392,12 @@ class MgformatMagicDirective {
3393
3392
  break;
3394
3393
  }
3395
3394
  if (cnt > 0)
3396
- pattern.AppendFormat("{{0},{1}}", inputAllChars ? cnt : 0, cnt);
3395
+ pattern.AppendFormat('{{0},{1}}', inputAllChars ? cnt : 0, cnt);
3397
3396
  if (closeSet)
3398
- pattern.Append(")");
3397
+ pattern.Append(')');
3399
3398
  closeSet = false;
3400
3399
  }
3401
- pattern.Append("$");
3400
+ pattern.Append('$');
3402
3401
  return pattern.ToString();
3403
3402
  }
3404
3403
  getDirectiveCount(mask, idx, pattern, changeInPattern) {
@@ -4132,11 +4131,10 @@ class NonMagicControlDirective {
4132
4131
  regEvents() {
4133
4132
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
4134
4133
  Object.keys(this.eventHandlers).forEach((key) => {
4135
- this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
4136
4134
  });
4137
4135
  }
4138
4136
  OnFocus() {
4139
- this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', "", -1));
4137
+ this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
4140
4138
  event.cancelBubble = true;
4141
4139
  }
4142
4140
  ngOnInit() {
@@ -4293,7 +4291,7 @@ class MgDateAdapter extends NativeDateAdapter {
4293
4291
  }
4294
4292
  parse(value) {
4295
4293
  let valueStr = value;
4296
- let date = 0, month = 0, year = 0, monthStr = null;
4294
+ let date = 0, month = 0, year = 0;
4297
4295
  let mgDateMask = this.mgdtfmt;
4298
4296
  let sep = valueStr.indexOf('/') > 0 ? '/' : '-';
4299
4297
  if (value == null || value == "")
@@ -4302,9 +4300,8 @@ class MgDateAdapter extends NativeDateAdapter {
4302
4300
  this.mgdtfmt = this.task.mgInputDateFormat;
4303
4301
  if ((this.mgdtfmt.indexOf('MMM') > 0) || (this.mgdtfmt.indexOf('MMMM') > 0))
4304
4302
  return new Date(value);
4305
- let vallen = valueStr.length;
4306
4303
  if (mgDateMask !== null) {
4307
- for (let i = 0, j = 0; i < mgDateMask.length;) {
4304
+ for (let i = 0; i < mgDateMask.length;) {
4308
4305
  switch (mgDateMask[i]) {
4309
4306
  case 'd':
4310
4307
  {
@@ -4390,14 +4387,6 @@ const magicProviders = [
4390
4387
  ];
4391
4388
 
4392
4389
  class utils {
4393
- static addChildren(parent, children, selector) {
4394
- for (var i = 0; i < parent.children.length; i++) {
4395
- if (typeof parent.children[i].attributes[selector] !== "undefined") {
4396
- children.push(parent.children[i]);
4397
- }
4398
- this.addChildren(parent.children[i], children, selector);
4399
- }
4400
- }
4401
4390
  static getDistance(control, x, y) {
4402
4391
  let left = control.clientLeft, top = control.clientTop;
4403
4392
  let dx, dy;