@magic-xpa/angular 4.801.0-dev481.293 → 4.801.0-dev481.300

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 (28) hide show
  1. package/esm2020/src/services/accessor.magic.service.mjs +1 -1
  2. package/esm2020/src/services/magic-color.service.mjs +36 -12
  3. package/esm2020/src/services/mg-date-adapter.mjs +3 -4
  4. package/esm2020/src/services/subform.magic.service.mjs +6 -7
  5. package/esm2020/src/ui/components/magic-alert.component.mjs +3 -7
  6. package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +4 -9
  7. package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +5 -6
  8. package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +1 -2
  9. package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +5 -6
  10. package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +20 -22
  11. package/esm2020/src/ui/magic-confirmationBox.mjs +1 -2
  12. package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +15 -21
  13. package/esm2020/src/ui/mgerror.magic.component.mjs +2 -3
  14. package/esm2020/src/ui/router-container.magic.component.mjs +1 -2
  15. package/esm2020/src/ui/task-base.magic.component.mjs +2 -2
  16. package/esm2020/src/ui/utils.mjs +1 -9
  17. package/fesm2015/magic-xpa-angular.mjs +82 -89
  18. package/fesm2015/magic-xpa-angular.mjs.map +1 -1
  19. package/fesm2020/magic-xpa-angular.mjs +80 -89
  20. package/fesm2020/magic-xpa-angular.mjs.map +1 -1
  21. package/package.json +3 -3
  22. package/src/services/accessor.magic.service.d.ts +1 -1
  23. package/src/services/magic-color.service.d.ts +6 -2
  24. package/src/ui/directives/NonMagicControlDirective.d.ts +4 -5
  25. package/src/ui/directives/magicViewContainerRef.directive.d.ts +2 -3
  26. package/src/ui/directives/mgformat.magic.directive.d.ts +6 -6
  27. package/src/ui/magic-modal/magic-overlay-container.d.ts +2 -3
  28. package/src/ui/utils.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  import { isNullOrUndefined, NString, List, isUndefined, StringBuilder, RefParam } from '@magic-xpa/mscorelib';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Component, Input, Output, EventEmitter, Directive, ViewChild, HostListener, Optional, Pipe, forwardRef, NgModule } from '@angular/core';
3
+ import { Injectable, Component, Input, Output, EventEmitter, Directive, ViewChild, InjectionToken, Inject, HostListener, Optional, Pipe, forwardRef, NgModule } from '@angular/core';
4
4
  import * as i1 from '@angular/common';
5
5
  import { DatePipe, CommonModule, formatDate } from '@angular/common';
6
6
  import * as i2 from '@angular/router';
@@ -467,7 +467,7 @@ class SubformMagicService {
467
467
  return this.subformsDict[subformName].parameters;
468
468
  }
469
469
  else
470
- return "";
470
+ return '';
471
471
  }
472
472
  deleteSubformComp(subformControlName, formName) {
473
473
  if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
@@ -491,8 +491,8 @@ class SubformMagicService {
491
491
  if (moduleRef == null) {
492
492
  let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
493
493
  if (lazyLoadModule != null) {
494
- let moduleName = lazyLoadModule.moduleName.replace("Magic", "");
495
- moduleName = moduleName.replace("Module", "");
494
+ let moduleName = lazyLoadModule.moduleName.replace('Magic', '');
495
+ moduleName = moduleName.replace('Module', '');
496
496
  this.loader.Load(moduleName).then(m => {
497
497
  const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
498
498
  moduleRef = compiled.ngModuleFactory.create(this.injector);
@@ -514,7 +514,7 @@ class SubformMagicService {
514
514
  }
515
515
  else {
516
516
  if (inDefaultOutlet)
517
- subformControlName = "primary";
517
+ subformControlName = 'primary';
518
518
  let routeParams = new List();
519
519
  routeParams.push(routerPath);
520
520
  if (params !== null) {
@@ -536,7 +536,6 @@ class SubformMagicService {
536
536
  this.task.refreshView();
537
537
  }
538
538
  ExecuteRouteCommand(routeCommand) {
539
- let reusingComponent = false;
540
539
  let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
541
540
  let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
542
541
  if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
@@ -595,7 +594,7 @@ class SubformMagicService {
595
594
  if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
596
595
  currentActiveRoute = currentActiveRoute.parent;
597
596
  if (!currentActiveRoute.snapshot.routeConfig.loadChildren)
598
- console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.");
597
+ console.log('getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.');
599
598
  }
600
599
  return currentActiveRoute;
601
600
  }
@@ -628,7 +627,6 @@ class RouterContainerMagicComponent {
628
627
  return RouterContainerMagicComponent.lastRoute;
629
628
  }
630
629
  ngOnInit() {
631
- let outletname = this.activatedRoute.outlet;
632
630
  let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
633
631
  let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
634
632
  RouterContainerMagicComponent.lastRoute = this.router.url;
@@ -891,14 +889,13 @@ MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective,
891
889
  })();
892
890
 
893
891
  class MagicViewContainerRef {
894
- constructor(vcRef, resolver) {
892
+ constructor(vcRef) {
895
893
  this.vcRef = vcRef;
896
- this.resolver = resolver;
897
894
  let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
898
895
  comp.setViewContainerRef(vcRef);
899
896
  }
900
897
  }
901
- MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
898
+ MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
902
899
  MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
903
900
  (function () {
904
901
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
@@ -906,7 +903,7 @@ MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerR
906
903
  args: [{
907
904
  selector: '[magicViewContainerRef]',
908
905
  }]
909
- }], function () { return [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }]; }, null);
906
+ }], function () { return [{ type: i0.ViewContainerRef }]; }, null);
910
907
  })();
911
908
 
912
909
  const _c0$3 = ["overlayContainerWrapper"];
@@ -1067,7 +1064,6 @@ class confirmationBox {
1067
1064
  }
1068
1065
  static showConfirmationBox(title, message, style) {
1069
1066
  let okWasPressed = false;
1070
- let retValue = Styles.MSGBOX_RESULT_OK;
1071
1067
  let isConfirm = this.isConfirmBox(style);
1072
1068
  let titleAndString = title + '\n' + '\n' + message;
1073
1069
  if (isConfirm)
@@ -1099,8 +1095,7 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) {
1099
1095
  i0.ɵɵelementStart(3, "button", 11);
1100
1096
  i0.ɵɵlistener("click", function MagicOverlayContainer_div_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.OnClose(); });
1101
1097
  i0.ɵɵtext(4, "X");
1102
- i0.ɵɵelementEnd();
1103
- i0.ɵɵelementEnd();
1098
+ i0.ɵɵelementEnd()();
1104
1099
  }
1105
1100
  if (rf & 2) {
1106
1101
  const ctx_r2 = i0.ɵɵnextContext();
@@ -1109,9 +1104,8 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) {
1109
1104
  }
1110
1105
  }
1111
1106
  class MagicOverlayContainer extends BaseMagicOverlayContainer {
1112
- constructor(injector, componentFactoryResolver) {
1107
+ constructor(componentFactoryResolver) {
1113
1108
  super();
1114
- this.injector = injector;
1115
1109
  this.componentFactoryResolver = componentFactoryResolver;
1116
1110
  this.ModalComp = null;
1117
1111
  this.ModalCompParameters = {};
@@ -1132,7 +1126,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1132
1126
  return comp.FormName();
1133
1127
  }
1134
1128
  else
1135
- return "";
1129
+ return '';
1136
1130
  }
1137
1131
  getStyle() {
1138
1132
  let styles = {};
@@ -1141,11 +1135,11 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1141
1135
  styles['width'] = comp.Width();
1142
1136
  styles['height'] = comp.Height();
1143
1137
  if (comp.IsCenteredToWindow()) {
1144
- styles['margin'] = "auto";
1138
+ styles['margin'] = 'auto';
1145
1139
  }
1146
1140
  else {
1147
- styles['margin-left'] = comp.X() + "px";
1148
- styles['margin-top'] = comp.Y() + "px";
1141
+ styles['margin-left'] = comp.X() + 'px';
1142
+ styles['margin-top'] = comp.Y() + 'px';
1149
1143
  }
1150
1144
  }
1151
1145
  return styles;
@@ -1153,15 +1147,14 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1153
1147
  getClientAreaStyles() {
1154
1148
  let styles = {};
1155
1149
  if (this.componentRef != undefined) {
1156
- let comp = this.componentRef.instance;
1157
1150
  const headerHeight = this.getShowTitleBar() && !isNullOrUndefined(this.headerElementRef) ? (this.headerElementRef.nativeElement.offsetHeight + 1) : 0;
1158
1151
  if (!isNullOrUndefined(this.foregroundElementRef)) {
1159
1152
  const foregroundHeight = this.foregroundElementRef.nativeElement.offsetHeight;
1160
- styles['height'] = (foregroundHeight - headerHeight) + "px";
1153
+ styles['height'] = (foregroundHeight - headerHeight) + 'px';
1161
1154
  const foregroundWidth = this.foregroundElementRef.nativeElement.offsetWidth;
1162
- styles['width'] = (foregroundWidth) + "px";
1155
+ styles['width'] = (foregroundWidth) + 'px';
1163
1156
  }
1164
- styles['overflow'] = "auto";
1157
+ styles['overflow'] = 'auto';
1165
1158
  }
1166
1159
  return styles;
1167
1160
  }
@@ -1180,7 +1173,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1180
1173
  this.OnClose();
1181
1174
  }
1182
1175
  }
1183
- MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
1176
+ MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
1184
1177
  MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
1185
1178
  if (rf & 1) {
1186
1179
  i0.ɵɵviewQuery(_c0$2, 5);
@@ -1193,8 +1186,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1193
1186
  }
1194
1187
  }, inputs: { ModalComp: "ModalComp", ModalCompParameters: "ModalCompParameters" }, outputs: { onClose: "onClose" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 4, consts: [[1, "modal-background", 3, "click"], ["tabindex", "-1", "style", "float:right; border: none; background-color: transparent; outline: none; color: white", 3, "click", 4, "ngIf"], [1, "modal-foreground", 3, "ngStyle"], ["modalForeground", ""], ["class", "modal-header", 4, "ngIf"], [3, "ngStyle"], ["magicViewContainerRef", ""], ["modalbody", ""], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white", 3, "click"], [1, "modal-header"], ["modalheader", ""], ["tabindex", "-1", 2, "float", "right", 3, "click"]], template: function MagicOverlayContainer_Template(rf, ctx) {
1195
1188
  if (rf & 1) {
1196
- i0.ɵɵelementStart(0, "div");
1197
- i0.ɵɵelementStart(1, "div", 0);
1189
+ i0.ɵɵelementStart(0, "div")(1, "div", 0);
1198
1190
  i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
1199
1191
  i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button", 1);
1200
1192
  i0.ɵɵelementEnd();
@@ -1202,9 +1194,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1202
1194
  i0.ɵɵtemplate(5, MagicOverlayContainer_div_5_Template, 5, 1, "div", 4);
1203
1195
  i0.ɵɵelementStart(6, "div", 5);
1204
1196
  i0.ɵɵelement(7, "div", 6, 7);
1205
- i0.ɵɵelementEnd();
1206
- i0.ɵɵelementEnd();
1207
- i0.ɵɵelementEnd();
1197
+ i0.ɵɵelementEnd()()();
1208
1198
  }
1209
1199
  if (rf & 2) {
1210
1200
  i0.ɵɵadvance(2);
@@ -1237,7 +1227,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1237
1227
  </div>
1238
1228
  </div>
1239
1229
  `, 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"] }]
1240
- }], function () { return [{ type: i0.Injector }, { type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
1230
+ }], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
1241
1231
  type: ViewChild,
1242
1232
  args: ['modalheader', { static: false }]
1243
1233
  }], foregroundElementRef: [{
@@ -1270,9 +1260,7 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
1270
1260
  MagicAlertComponent.ɵfac = function () { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(t) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(t || MagicAlertComponent); }; }();
1271
1261
  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) {
1272
1262
  if (rf & 1) {
1273
- i0.ɵɵelementStart(0, "div");
1274
- i0.ɵɵelementStart(1, "div", 0);
1275
- i0.ɵɵelementStart(2, "h2");
1263
+ i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
1276
1264
  i0.ɵɵtext(3);
1277
1265
  i0.ɵɵelementEnd();
1278
1266
  i0.ɵɵelementStart(4, "p");
@@ -1281,9 +1269,7 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
1281
1269
  i0.ɵɵelementStart(6, "button", 1);
1282
1270
  i0.ɵɵlistener("click", function MagicAlertComponent_Template_button_click_6_listener() { return ctx.OnClose(); });
1283
1271
  i0.ɵɵtext(7, "OK");
1284
- i0.ɵɵelementEnd();
1285
- i0.ɵɵelementEnd();
1286
- i0.ɵɵelementEnd();
1272
+ i0.ɵɵelementEnd()()();
1287
1273
  }
1288
1274
  if (rf & 2) {
1289
1275
  i0.ɵɵadvance(3);
@@ -1343,14 +1329,11 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
1343
1329
  MagicConfirmationBoxComponent.ɵfac = function () { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(t) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(t || MagicConfirmationBoxComponent); }; }();
1344
1330
  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) {
1345
1331
  if (rf & 1) {
1346
- i0.ɵɵelementStart(0, "div");
1347
- i0.ɵɵelementStart(1, "div", 0);
1348
- i0.ɵɵelementStart(2, "h2");
1332
+ i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
1349
1333
  i0.ɵɵtext(3);
1350
1334
  i0.ɵɵelementEnd();
1351
1335
  i0.ɵɵtext(4);
1352
- i0.ɵɵelement(5, "br");
1353
- i0.ɵɵelement(6, "br");
1336
+ i0.ɵɵelement(5, "br")(6, "br");
1354
1337
  i0.ɵɵelementStart(7, "button", 1);
1355
1338
  i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_7_listener() { return ctx.OnClose(true); });
1356
1339
  i0.ɵɵtext(8, "OK");
@@ -1358,9 +1341,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
1358
1341
  i0.ɵɵelementStart(9, "button", 2);
1359
1342
  i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_9_listener() { return ctx.OnClose(false); });
1360
1343
  i0.ɵɵtext(10, "Cancel");
1361
- i0.ɵɵelementEnd();
1362
- i0.ɵɵelementEnd();
1363
- i0.ɵɵelementEnd();
1344
+ i0.ɵɵelementEnd()()();
1364
1345
  }
1365
1346
  if (rf & 2) {
1366
1347
  i0.ɵɵadvance(3);
@@ -2318,15 +2299,30 @@ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, f
2318
2299
  }], function () { return [{ type: i1$1.Title }]; }, null);
2319
2300
  })();
2320
2301
 
2302
+ let COLOR_FILE_NAME = new InjectionToken('colorFile', {
2303
+ providedIn: 'root',
2304
+ factory: () => 'clr_rnt.eng'
2305
+ });
2321
2306
  const MAGIC_FG_COLOR = 1;
2322
2307
  const MAGIC_BG_COLOR = 2;
2323
2308
  class MagicColorService {
2324
- constructor(http) {
2309
+ constructor(http, colorFile1 = 'clr_rnt.eng') {
2325
2310
  this.http = http;
2326
- this.colorFilePath = 'assets/clr_rnt.eng';
2327
- this.http.get(this.colorFilePath, { responseType: 'text' }).subscribe(resp => {
2328
- this.colorsData = resp.replace(/\n/g, '@').split('@');
2329
- });
2311
+ this.colorFileName = 'clr_rnt.eng';
2312
+ if (colorFile1)
2313
+ this.colorFileName = colorFile1;
2314
+ else
2315
+ this.colorFileName = 'clr_rnt.eng';
2316
+ }
2317
+ getColorFilePath() {
2318
+ return 'assets/' + this.colorFileName;
2319
+ }
2320
+ getColorData() {
2321
+ if (!this.colorsData) {
2322
+ this.http.get(this.getColorFilePath(), { responseType: 'text' }).subscribe(resp => {
2323
+ this.colorsData = resp.replace(/\n/g, '@').split('@');
2324
+ });
2325
+ }
2330
2326
  }
2331
2327
  hexToRgba(hex) {
2332
2328
  let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
@@ -2343,28 +2339,34 @@ class MagicColorService {
2343
2339
  return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
2344
2340
  }
2345
2341
  getColor(colorIndex, colorType) {
2346
- if (this.colorsData && this.colorsData[colorIndex]) {
2342
+ if (!this.colorsData)
2343
+ this.getColorData();
2344
+ if (this.colorsData && this.colorsData[colorIndex - 1]) {
2347
2345
  let hex = '';
2348
2346
  const grayHashCode = '00808080';
2349
2347
  let color = this.colorsData[colorIndex].split(',');
2350
2348
  if (+color[3] <= 1) {
2351
2349
  switch (colorType) {
2352
2350
  case MAGIC_FG_COLOR:
2353
- hex = ('#' + color[1]);
2351
+ hex = (color[1]);
2354
2352
  break;
2355
2353
  case MAGIC_BG_COLOR:
2356
- hex = ('#' + color[2]);
2354
+ hex = (color[2]);
2357
2355
  break;
2356
+ default:
2357
+ console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
2358
+ return '';
2358
2359
  }
2359
2360
  }
2360
2361
  else
2361
2362
  hex = grayHashCode;
2362
2363
  return this.hexToRgba('#' + hex);
2363
2364
  }
2365
+ console.log('Could not get color for number ' + colorIndex);
2364
2366
  return '';
2365
2367
  }
2366
2368
  }
2367
- MagicColorService.ɵfac = function MagicColorService_Factory(t) { return new (t || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient)); };
2369
+ MagicColorService.ɵfac = function MagicColorService_Factory(t) { return new (t || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(COLOR_FILE_NAME)); };
2368
2370
  MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
2369
2371
  (function () {
2370
2372
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
@@ -2372,7 +2374,12 @@ MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, f
2372
2374
  args: [{
2373
2375
  providedIn: 'root'
2374
2376
  }]
2375
- }], function () { return [{ type: i1$2.HttpClient }]; }, null);
2377
+ }], function () {
2378
+ return [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
2379
+ type: Inject,
2380
+ args: [COLOR_FILE_NAME]
2381
+ }] }];
2382
+ }, null);
2376
2383
  })();
2377
2384
 
2378
2385
  class AccessorMagicService {
@@ -2721,7 +2728,7 @@ class TaskBaseMagicComponent {
2721
2728
  return this.task.ScreenModeControls;
2722
2729
  }
2723
2730
  ngOnInit() {
2724
- let subscription = this.task.detectChanges.pipe().subscribe(c => {
2731
+ this.task.detectChanges.pipe().subscribe(c => {
2725
2732
  this.ref.detectChanges();
2726
2733
  });
2727
2734
  this.task.initTask(this.taskIdParam, this.taskDescription);
@@ -3040,7 +3047,6 @@ class NoControlMagicDirective extends MagicDirective {
3040
3047
  }
3041
3048
  if (this.isRadio()) {
3042
3049
  this.htmlElement.addEventListener('change', (e) => {
3043
- let result = this.task.getFormControl('0', this.id);
3044
3050
  let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
3045
3051
  guiEvent.Value = (e.target).value;
3046
3052
  this.task.insertEvent(guiEvent);
@@ -3401,7 +3407,7 @@ class MgformatMagicDirective {
3401
3407
  }
3402
3408
  }
3403
3409
  generatePattern(attribute, pic) {
3404
- let pattern = "";
3410
+ let pattern = '';
3405
3411
  switch (attribute) {
3406
3412
  case StorageAttribute.NUMERIC:
3407
3413
  pattern = this.generatePatternForNumber(pic);
@@ -3415,14 +3421,14 @@ class MgformatMagicDirective {
3415
3421
  }
3416
3422
  generatePatternForNumber(pic) {
3417
3423
  let patternStr = new StringBuilder();
3418
- patternStr.Append("^");
3424
+ patternStr.Append('^');
3419
3425
  if (pic.isNegative())
3420
- patternStr.Append("-?");
3426
+ patternStr.Append('-?');
3421
3427
  if (pic.getWholes())
3422
- patternStr.AppendFormat("\\d{{0},{1}}", 0, pic.getWholes());
3428
+ patternStr.AppendFormat('\\d{{0},{1}}', 0, pic.getWholes());
3423
3429
  if (pic.getDec())
3424
- patternStr.AppendFormat("(\\.\\d{1,{0}})?", pic.getDec());
3425
- patternStr.Append("$");
3430
+ patternStr.AppendFormat('(\\.\\d{1,{0}})?', pic.getDec());
3431
+ patternStr.Append('$');
3426
3432
  return patternStr.ToString();
3427
3433
  }
3428
3434
  isPatternGenerationNeeded(attr, pic) {
@@ -3438,15 +3444,13 @@ class MgformatMagicDirective {
3438
3444
  let cnt = 0;
3439
3445
  let inputAllChars = false;
3440
3446
  let closeSet = false;
3441
- let val = null;
3442
- let allowMulitiline = false;
3443
3447
  let mask = pic.getMask();
3444
3448
  let pattern = new StringBuilder();
3445
- pattern.Append("^");
3449
+ pattern.Append('^');
3446
3450
  for (let i = 0; i < mask.length;) {
3447
3451
  if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
3448
3452
  || mask.charCodeAt(i) == PICInterface.PIC_X)) {
3449
- pattern.Append("(");
3453
+ pattern.Append('(');
3450
3454
  closeSet = true;
3451
3455
  inputAllChars = false;
3452
3456
  }
@@ -3456,7 +3460,7 @@ class MgformatMagicDirective {
3456
3460
  case PICInterface.PIC_X:
3457
3461
  case PICInterface.PIC_L:
3458
3462
  {
3459
- pattern.Append(".");
3463
+ pattern.Append('.');
3460
3464
  let inputAllCharsRef = new RefParam(false);
3461
3465
  let dirs = PICInterface.PIC_U.toString();
3462
3466
  dirs += PICInterface.PIC_L.toString();
@@ -3468,7 +3472,7 @@ class MgformatMagicDirective {
3468
3472
  break;
3469
3473
  case PICInterface.PIC_N:
3470
3474
  {
3471
- pattern.Append("\\d");
3475
+ pattern.Append('\\d');
3472
3476
  let inputAllCharsRef = new RefParam(false);
3473
3477
  cnt = this.getDirectiveCount(mask, i, PICInterface.PIC_L.toString(), inputAllCharsRef);
3474
3478
  inputAllChars = inputAllCharsRef.value;
@@ -3481,12 +3485,12 @@ class MgformatMagicDirective {
3481
3485
  break;
3482
3486
  }
3483
3487
  if (cnt > 0)
3484
- pattern.AppendFormat("{{0},{1}}", inputAllChars ? cnt : 0, cnt);
3488
+ pattern.AppendFormat('{{0},{1}}', inputAllChars ? cnt : 0, cnt);
3485
3489
  if (closeSet)
3486
- pattern.Append(")");
3490
+ pattern.Append(')');
3487
3491
  closeSet = false;
3488
3492
  }
3489
- pattern.Append("$");
3493
+ pattern.Append('$');
3490
3494
  return pattern.ToString();
3491
3495
  }
3492
3496
  getDirectiveCount(mask, idx, pattern, changeInPattern) {
@@ -3697,8 +3701,7 @@ function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) {
3697
3701
  }
3698
3702
  function ErrorMagicComponent_div_0_Template(rf, ctx) {
3699
3703
  if (rf & 1) {
3700
- i0.ɵɵelementStart(0, "div");
3701
- i0.ɵɵelementStart(1, "div", null, 1);
3704
+ i0.ɵɵelementStart(0, "div")(1, "div", null, 1);
3702
3705
  i0.ɵɵprojection(3);
3703
3706
  i0.ɵɵelementEnd();
3704
3707
  i0.ɵɵtemplate(4, ErrorMagicComponent_div_0_span_4_Template, 2, 1, "span", 0);
@@ -4300,11 +4303,10 @@ class NonMagicControlDirective {
4300
4303
  regEvents() {
4301
4304
  this.eventHandlers['focusin'] = this.OnFocus.bind(this);
4302
4305
  Object.keys(this.eventHandlers).forEach((key) => {
4303
- this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
4304
4306
  });
4305
4307
  }
4306
4308
  OnFocus() {
4307
- this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', "", -1));
4309
+ this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
4308
4310
  event.cancelBubble = true;
4309
4311
  }
4310
4312
  ngOnInit() {
@@ -4467,7 +4469,7 @@ class MgDateAdapter extends NativeDateAdapter {
4467
4469
  }
4468
4470
  parse(value) {
4469
4471
  let valueStr = value;
4470
- let date = 0, month = 0, year = 0, monthStr = null;
4472
+ let date = 0, month = 0, year = 0;
4471
4473
  let mgDateMask = this.mgdtfmt;
4472
4474
  let sep = valueStr.indexOf('/') > 0 ? '/' : '-';
4473
4475
  if (value == null || value == "")
@@ -4476,9 +4478,8 @@ class MgDateAdapter extends NativeDateAdapter {
4476
4478
  this.mgdtfmt = this.task.mgInputDateFormat;
4477
4479
  if ((this.mgdtfmt.indexOf('MMM') > 0) || (this.mgdtfmt.indexOf('MMMM') > 0))
4478
4480
  return new Date(value);
4479
- let vallen = valueStr.length;
4480
4481
  if (mgDateMask !== null) {
4481
- for (let i = 0, j = 0; i < mgDateMask.length;) {
4482
+ for (let i = 0; i < mgDateMask.length;) {
4482
4483
  switch (mgDateMask[i]) {
4483
4484
  case 'd':
4484
4485
  {
@@ -4566,14 +4567,6 @@ const magicProviders = [
4566
4567
  ];
4567
4568
 
4568
4569
  class utils {
4569
- static addChildren(parent, children, selector) {
4570
- for (var i = 0; i < parent.children.length; i++) {
4571
- if (typeof parent.children[i].attributes[selector] !== "undefined") {
4572
- children.push(parent.children[i]);
4573
- }
4574
- this.addChildren(parent.children[i], children, selector);
4575
- }
4576
- }
4577
4570
  static getDistance(control, x, y) {
4578
4571
  let left = control.clientLeft, top = control.clientTop;
4579
4572
  let dx, dy;
@@ -4635,5 +4628,5 @@ class ModalFormDefinition {
4635
4628
  }
4636
4629
  }
4637
4630
 
4638
- export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
4631
+ export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, COLOR_FILE_NAME, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
4639
4632
  //# sourceMappingURL=magic-xpa-angular.mjs.map