@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.
- package/esm2020/src/services/accessor.magic.service.mjs +1 -1
- package/esm2020/src/services/magic-color.service.mjs +36 -12
- package/esm2020/src/ui/components/magic-alert.component.mjs +3 -7
- package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +4 -9
- package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +4 -8
- package/esm2020/src/ui/mgerror.magic.component.mjs +2 -3
- package/fesm2015/magic-xpa-angular.mjs +47 -35
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +45 -35
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/package.json +3 -3
- package/src/services/accessor.magic.service.d.ts +1 -1
- package/src/services/magic-color.service.d.ts +6 -2
|
@@ -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, Directive, EventEmitter, ViewChild, HostListener, Optional, Pipe, forwardRef, NgModule } from '@angular/core';
|
|
3
|
+
import { Injectable, Component, Input, Output, Directive, EventEmitter, 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';
|
|
@@ -831,8 +831,7 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
831
831
|
i0.ɵɵelementStart(3, "button", 11);
|
|
832
832
|
i0.ɵɵlistener("click", function MagicOverlayContainer_div_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.OnClose(); });
|
|
833
833
|
i0.ɵɵtext(4, "X");
|
|
834
|
-
i0.ɵɵelementEnd();
|
|
835
|
-
i0.ɵɵelementEnd();
|
|
834
|
+
i0.ɵɵelementEnd()();
|
|
836
835
|
} if (rf & 2) {
|
|
837
836
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
838
837
|
i0.ɵɵadvance(2);
|
|
@@ -917,8 +916,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
917
916
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerElementRef = _t.first);
|
|
918
917
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.foregroundElementRef = _t.first);
|
|
919
918
|
} }, 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) { if (rf & 1) {
|
|
920
|
-
i0.ɵɵelementStart(0, "div");
|
|
921
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
919
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0);
|
|
922
920
|
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
|
|
923
921
|
i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button", 1);
|
|
924
922
|
i0.ɵɵelementEnd();
|
|
@@ -926,9 +924,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
926
924
|
i0.ɵɵtemplate(5, MagicOverlayContainer_div_5_Template, 5, 1, "div", 4);
|
|
927
925
|
i0.ɵɵelementStart(6, "div", 5);
|
|
928
926
|
i0.ɵɵelement(7, "div", 6, 7);
|
|
929
|
-
i0.ɵɵelementEnd();
|
|
930
|
-
i0.ɵɵelementEnd();
|
|
931
|
-
i0.ɵɵelementEnd();
|
|
927
|
+
i0.ɵɵelementEnd()()();
|
|
932
928
|
} if (rf & 2) {
|
|
933
929
|
i0.ɵɵadvance(2);
|
|
934
930
|
i0.ɵɵproperty("ngIf", !ctx.getShowTitleBar());
|
|
@@ -1176,9 +1172,7 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
|
1176
1172
|
}
|
|
1177
1173
|
MagicAlertComponent.ɵfac = function () { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(t) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(t || MagicAlertComponent); }; }();
|
|
1178
1174
|
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) { if (rf & 1) {
|
|
1179
|
-
i0.ɵɵelementStart(0, "div");
|
|
1180
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
1181
|
-
i0.ɵɵelementStart(2, "h2");
|
|
1175
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
|
1182
1176
|
i0.ɵɵtext(3);
|
|
1183
1177
|
i0.ɵɵelementEnd();
|
|
1184
1178
|
i0.ɵɵelementStart(4, "p");
|
|
@@ -1187,9 +1181,7 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
|
|
|
1187
1181
|
i0.ɵɵelementStart(6, "button", 1);
|
|
1188
1182
|
i0.ɵɵlistener("click", function MagicAlertComponent_Template_button_click_6_listener() { return ctx.OnClose(); });
|
|
1189
1183
|
i0.ɵɵtext(7, "OK");
|
|
1190
|
-
i0.ɵɵelementEnd();
|
|
1191
|
-
i0.ɵɵelementEnd();
|
|
1192
|
-
i0.ɵɵelementEnd();
|
|
1184
|
+
i0.ɵɵelementEnd()()();
|
|
1193
1185
|
} if (rf & 2) {
|
|
1194
1186
|
i0.ɵɵadvance(3);
|
|
1195
1187
|
i0.ɵɵtextInterpolate1(" ", ctx.title, "");
|
|
@@ -1244,14 +1236,11 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
|
1244
1236
|
}
|
|
1245
1237
|
MagicConfirmationBoxComponent.ɵfac = function () { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(t) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(t || MagicConfirmationBoxComponent); }; }();
|
|
1246
1238
|
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) { if (rf & 1) {
|
|
1247
|
-
i0.ɵɵelementStart(0, "div");
|
|
1248
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
1249
|
-
i0.ɵɵelementStart(2, "h2");
|
|
1239
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
|
1250
1240
|
i0.ɵɵtext(3);
|
|
1251
1241
|
i0.ɵɵelementEnd();
|
|
1252
1242
|
i0.ɵɵtext(4);
|
|
1253
|
-
i0.ɵɵelement(5, "br");
|
|
1254
|
-
i0.ɵɵelement(6, "br");
|
|
1243
|
+
i0.ɵɵelement(5, "br")(6, "br");
|
|
1255
1244
|
i0.ɵɵelementStart(7, "button", 1);
|
|
1256
1245
|
i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_7_listener() { return ctx.OnClose(true); });
|
|
1257
1246
|
i0.ɵɵtext(8, "OK");
|
|
@@ -1259,9 +1248,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
|
|
|
1259
1248
|
i0.ɵɵelementStart(9, "button", 2);
|
|
1260
1249
|
i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_9_listener() { return ctx.OnClose(false); });
|
|
1261
1250
|
i0.ɵɵtext(10, "Cancel");
|
|
1262
|
-
i0.ɵɵelementEnd();
|
|
1263
|
-
i0.ɵɵelementEnd();
|
|
1264
|
-
i0.ɵɵelementEnd();
|
|
1251
|
+
i0.ɵɵelementEnd()()();
|
|
1265
1252
|
} if (rf & 2) {
|
|
1266
1253
|
i0.ɵɵadvance(3);
|
|
1267
1254
|
i0.ɵɵtextInterpolate1(" ", ctx.title, "");
|
|
@@ -2246,15 +2233,30 @@ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, f
|
|
|
2246
2233
|
type: Injectable
|
|
2247
2234
|
}], function () { return [{ type: i1$1.Title }]; }, null); })();
|
|
2248
2235
|
|
|
2236
|
+
let COLOR_FILE_NAME = new InjectionToken('colorFile', {
|
|
2237
|
+
providedIn: 'root',
|
|
2238
|
+
factory: () => 'clr_rnt.eng'
|
|
2239
|
+
});
|
|
2249
2240
|
const MAGIC_FG_COLOR = 1;
|
|
2250
2241
|
const MAGIC_BG_COLOR = 2;
|
|
2251
2242
|
class MagicColorService {
|
|
2252
|
-
constructor(http) {
|
|
2243
|
+
constructor(http, colorFile1 = 'clr_rnt.eng') {
|
|
2253
2244
|
this.http = http;
|
|
2254
|
-
this.
|
|
2255
|
-
|
|
2256
|
-
this.
|
|
2257
|
-
|
|
2245
|
+
this.colorFileName = 'clr_rnt.eng';
|
|
2246
|
+
if (colorFile1)
|
|
2247
|
+
this.colorFileName = colorFile1;
|
|
2248
|
+
else
|
|
2249
|
+
this.colorFileName = 'clr_rnt.eng';
|
|
2250
|
+
}
|
|
2251
|
+
getColorFilePath() {
|
|
2252
|
+
return 'assets/' + this.colorFileName;
|
|
2253
|
+
}
|
|
2254
|
+
getColorData() {
|
|
2255
|
+
if (!this.colorsData) {
|
|
2256
|
+
this.http.get(this.getColorFilePath(), { responseType: 'text' }).subscribe(resp => {
|
|
2257
|
+
this.colorsData = resp.replace(/\n/g, '@').split('@');
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2258
2260
|
}
|
|
2259
2261
|
hexToRgba(hex) {
|
|
2260
2262
|
let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
@@ -2271,35 +2273,44 @@ class MagicColorService {
|
|
|
2271
2273
|
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
|
|
2272
2274
|
}
|
|
2273
2275
|
getColor(colorIndex, colorType) {
|
|
2274
|
-
if (this.colorsData
|
|
2276
|
+
if (!this.colorsData)
|
|
2277
|
+
this.getColorData();
|
|
2278
|
+
if (this.colorsData && this.colorsData[colorIndex - 1]) {
|
|
2275
2279
|
let hex = '';
|
|
2276
2280
|
const grayHashCode = '00808080';
|
|
2277
2281
|
let color = this.colorsData[colorIndex].split(',');
|
|
2278
2282
|
if (+color[3] <= 1) {
|
|
2279
2283
|
switch (colorType) {
|
|
2280
2284
|
case MAGIC_FG_COLOR:
|
|
2281
|
-
hex = (
|
|
2285
|
+
hex = (color[1]);
|
|
2282
2286
|
break;
|
|
2283
2287
|
case MAGIC_BG_COLOR:
|
|
2284
|
-
hex = (
|
|
2288
|
+
hex = (color[2]);
|
|
2285
2289
|
break;
|
|
2290
|
+
default:
|
|
2291
|
+
console.log('Please enter valid color type : 1-FG, 2-BG ' + colorIndex);
|
|
2292
|
+
return '';
|
|
2286
2293
|
}
|
|
2287
2294
|
}
|
|
2288
2295
|
else
|
|
2289
2296
|
hex = grayHashCode;
|
|
2290
2297
|
return this.hexToRgba('#' + hex);
|
|
2291
2298
|
}
|
|
2299
|
+
console.log('Could not get color for number ' + colorIndex);
|
|
2292
2300
|
return '';
|
|
2293
2301
|
}
|
|
2294
2302
|
}
|
|
2295
|
-
MagicColorService.ɵfac = function MagicColorService_Factory(t) { return new (t || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient)); };
|
|
2303
|
+
MagicColorService.ɵfac = function MagicColorService_Factory(t) { return new (t || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(COLOR_FILE_NAME)); };
|
|
2296
2304
|
MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
|
2297
2305
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
|
2298
2306
|
type: Injectable,
|
|
2299
2307
|
args: [{
|
|
2300
2308
|
providedIn: 'root'
|
|
2301
2309
|
}]
|
|
2302
|
-
}], function () { return [{ type: i1$2.HttpClient }
|
|
2310
|
+
}], function () { return [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
2311
|
+
type: Inject,
|
|
2312
|
+
args: [COLOR_FILE_NAME]
|
|
2313
|
+
}] }]; }, null); })();
|
|
2303
2314
|
|
|
2304
2315
|
class AccessorMagicService {
|
|
2305
2316
|
constructor(task, magicColor) {
|
|
@@ -3580,8 +3591,7 @@ function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
3580
3591
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.mgService.getErrMsg(ctx_r2.id, ctx_r2.rowId), " ");
|
|
3581
3592
|
} }
|
|
3582
3593
|
function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
3583
|
-
i0.ɵɵelementStart(0, "div");
|
|
3584
|
-
i0.ɵɵelementStart(1, "div", null, 1);
|
|
3594
|
+
i0.ɵɵelementStart(0, "div")(1, "div", null, 1);
|
|
3585
3595
|
i0.ɵɵprojection(3);
|
|
3586
3596
|
i0.ɵɵelementEnd();
|
|
3587
3597
|
i0.ɵɵtemplate(4, ErrorMagicComponent_div_0_span_4_Template, 2, 1, "span", 0);
|
|
@@ -4440,5 +4450,5 @@ class ModalFormDefinition {
|
|
|
4440
4450
|
}
|
|
4441
4451
|
}
|
|
4442
4452
|
|
|
4443
|
-
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 };
|
|
4453
|
+
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 };
|
|
4444
4454
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|