@magic-xpa/angular 4.801.0-dev481.297 → 4.801.0-dev481.301

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.
@@ -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';
@@ -1095,8 +1095,7 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) {
1095
1095
  i0.ɵɵelementStart(3, "button", 11);
1096
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(); });
1097
1097
  i0.ɵɵtext(4, "X");
1098
- i0.ɵɵelementEnd();
1099
- i0.ɵɵelementEnd();
1098
+ i0.ɵɵelementEnd()();
1100
1099
  }
1101
1100
  if (rf & 2) {
1102
1101
  const ctx_r2 = i0.ɵɵnextContext();
@@ -1187,8 +1186,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1187
1186
  }
1188
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) {
1189
1188
  if (rf & 1) {
1190
- i0.ɵɵelementStart(0, "div");
1191
- i0.ɵɵelementStart(1, "div", 0);
1189
+ i0.ɵɵelementStart(0, "div")(1, "div", 0);
1192
1190
  i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
1193
1191
  i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button", 1);
1194
1192
  i0.ɵɵelementEnd();
@@ -1196,9 +1194,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1196
1194
  i0.ɵɵtemplate(5, MagicOverlayContainer_div_5_Template, 5, 1, "div", 4);
1197
1195
  i0.ɵɵelementStart(6, "div", 5);
1198
1196
  i0.ɵɵelement(7, "div", 6, 7);
1199
- i0.ɵɵelementEnd();
1200
- i0.ɵɵelementEnd();
1201
- i0.ɵɵelementEnd();
1197
+ i0.ɵɵelementEnd()()();
1202
1198
  }
1203
1199
  if (rf & 2) {
1204
1200
  i0.ɵɵadvance(2);
@@ -1264,9 +1260,7 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
1264
1260
  MagicAlertComponent.ɵfac = function () { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(t) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(t || MagicAlertComponent); }; }();
1265
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) {
1266
1262
  if (rf & 1) {
1267
- i0.ɵɵelementStart(0, "div");
1268
- i0.ɵɵelementStart(1, "div", 0);
1269
- i0.ɵɵelementStart(2, "h2");
1263
+ i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
1270
1264
  i0.ɵɵtext(3);
1271
1265
  i0.ɵɵelementEnd();
1272
1266
  i0.ɵɵelementStart(4, "p");
@@ -1275,9 +1269,7 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
1275
1269
  i0.ɵɵelementStart(6, "button", 1);
1276
1270
  i0.ɵɵlistener("click", function MagicAlertComponent_Template_button_click_6_listener() { return ctx.OnClose(); });
1277
1271
  i0.ɵɵtext(7, "OK");
1278
- i0.ɵɵelementEnd();
1279
- i0.ɵɵelementEnd();
1280
- i0.ɵɵelementEnd();
1272
+ i0.ɵɵelementEnd()()();
1281
1273
  }
1282
1274
  if (rf & 2) {
1283
1275
  i0.ɵɵadvance(3);
@@ -1337,14 +1329,11 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
1337
1329
  MagicConfirmationBoxComponent.ɵfac = function () { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(t) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(t || MagicConfirmationBoxComponent); }; }();
1338
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) {
1339
1331
  if (rf & 1) {
1340
- i0.ɵɵelementStart(0, "div");
1341
- i0.ɵɵelementStart(1, "div", 0);
1342
- i0.ɵɵelementStart(2, "h2");
1332
+ i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
1343
1333
  i0.ɵɵtext(3);
1344
1334
  i0.ɵɵelementEnd();
1345
1335
  i0.ɵɵtext(4);
1346
- i0.ɵɵelement(5, "br");
1347
- i0.ɵɵelement(6, "br");
1336
+ i0.ɵɵelement(5, "br")(6, "br");
1348
1337
  i0.ɵɵelementStart(7, "button", 1);
1349
1338
  i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_7_listener() { return ctx.OnClose(true); });
1350
1339
  i0.ɵɵtext(8, "OK");
@@ -1352,9 +1341,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
1352
1341
  i0.ɵɵelementStart(9, "button", 2);
1353
1342
  i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_9_listener() { return ctx.OnClose(false); });
1354
1343
  i0.ɵɵtext(10, "Cancel");
1355
- i0.ɵɵelementEnd();
1356
- i0.ɵɵelementEnd();
1357
- i0.ɵɵelementEnd();
1344
+ i0.ɵɵelementEnd()()();
1358
1345
  }
1359
1346
  if (rf & 2) {
1360
1347
  i0.ɵɵadvance(3);
@@ -2312,15 +2299,30 @@ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, f
2312
2299
  }], function () { return [{ type: i1$1.Title }]; }, null);
2313
2300
  })();
2314
2301
 
2302
+ let COLOR_FILE_NAME = new InjectionToken('colorFile', {
2303
+ providedIn: 'root',
2304
+ factory: () => 'clr_rnt.eng'
2305
+ });
2315
2306
  const MAGIC_FG_COLOR = 1;
2316
2307
  const MAGIC_BG_COLOR = 2;
2317
2308
  class MagicColorService {
2318
- constructor(http) {
2309
+ constructor(http, colorFile1 = 'clr_rnt.eng') {
2319
2310
  this.http = http;
2320
- this.colorFilePath = 'assets/clr_rnt.eng';
2321
- this.http.get(this.colorFilePath, { responseType: 'text' }).subscribe(resp => {
2322
- this.colorsData = resp.replace(/\n/g, '@').split('@');
2323
- });
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
+ }
2324
2326
  }
2325
2327
  hexToRgba(hex) {
2326
2328
  let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
@@ -2337,28 +2339,34 @@ class MagicColorService {
2337
2339
  return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
2338
2340
  }
2339
2341
  getColor(colorIndex, colorType) {
2340
- if (this.colorsData && this.colorsData[colorIndex]) {
2342
+ if (!this.colorsData)
2343
+ this.getColorData();
2344
+ if (this.colorsData && this.colorsData[colorIndex - 1]) {
2341
2345
  let hex = '';
2342
2346
  const grayHashCode = '00808080';
2343
2347
  let color = this.colorsData[colorIndex].split(',');
2344
2348
  if (+color[3] <= 1) {
2345
2349
  switch (colorType) {
2346
2350
  case MAGIC_FG_COLOR:
2347
- hex = ('#' + color[1]);
2351
+ hex = (color[1]);
2348
2352
  break;
2349
2353
  case MAGIC_BG_COLOR:
2350
- hex = ('#' + color[2]);
2354
+ hex = (color[2]);
2351
2355
  break;
2356
+ default:
2357
+ console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
2358
+ return '';
2352
2359
  }
2353
2360
  }
2354
2361
  else
2355
2362
  hex = grayHashCode;
2356
2363
  return this.hexToRgba('#' + hex);
2357
2364
  }
2365
+ console.log('Could not get color for number ' + colorIndex);
2358
2366
  return '';
2359
2367
  }
2360
2368
  }
2361
- 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)); };
2362
2370
  MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
2363
2371
  (function () {
2364
2372
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
@@ -2366,7 +2374,12 @@ MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, f
2366
2374
  args: [{
2367
2375
  providedIn: 'root'
2368
2376
  }]
2369
- }], 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);
2370
2383
  })();
2371
2384
 
2372
2385
  class AccessorMagicService {
@@ -3688,8 +3701,7 @@ function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) {
3688
3701
  }
3689
3702
  function ErrorMagicComponent_div_0_Template(rf, ctx) {
3690
3703
  if (rf & 1) {
3691
- i0.ɵɵelementStart(0, "div");
3692
- i0.ɵɵelementStart(1, "div", null, 1);
3704
+ i0.ɵɵelementStart(0, "div")(1, "div", null, 1);
3693
3705
  i0.ɵɵprojection(3);
3694
3706
  i0.ɵɵelementEnd();
3695
3707
  i0.ɵɵtemplate(4, ErrorMagicComponent_div_0_span_4_Template, 2, 1, "span", 0);
@@ -4616,5 +4628,5 @@ class ModalFormDefinition {
4616
4628
  }
4617
4629
  }
4618
4630
 
4619
- 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 };
4620
4632
  //# sourceMappingURL=magic-xpa-angular.mjs.map