@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.
- package/esm2020/src/services/accessor.magic.service.mjs +1 -1
- package/esm2020/src/services/magic-color.service.mjs +36 -12
- package/esm2020/src/services/mg-date-adapter.mjs +3 -4
- package/esm2020/src/services/subform.magic.service.mjs +6 -7
- 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/directives/NonMagicControlDirective.mjs +5 -6
- package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +1 -2
- package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +5 -6
- package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +20 -22
- package/esm2020/src/ui/magic-confirmationBox.mjs +1 -2
- package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +15 -21
- package/esm2020/src/ui/mgerror.magic.component.mjs +2 -3
- package/esm2020/src/ui/router-container.magic.component.mjs +1 -2
- package/esm2020/src/ui/task-base.magic.component.mjs +2 -2
- package/esm2020/src/ui/utils.mjs +1 -9
- package/fesm2015/magic-xpa-angular.mjs +82 -89
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +80 -89
- 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
- package/src/ui/directives/NonMagicControlDirective.d.ts +4 -5
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +2 -3
- package/src/ui/directives/mgformat.magic.directive.d.ts +6 -6
- package/src/ui/magic-modal/magic-overlay-container.d.ts +2 -3
- 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, 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';
|
|
@@ -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(
|
|
483
|
-
moduleName = moduleName.replace(
|
|
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 =
|
|
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(
|
|
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
|
|
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)
|
|
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 }
|
|
816
|
+
}], function () { return [{ type: i0.ViewContainerRef }]; }, null); })();
|
|
820
817
|
|
|
821
818
|
const _c0$3 = ["modalheader"];
|
|
822
819
|
const _c1$1 = ["modalForeground"];
|
|
@@ -834,17 +831,15 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
834
831
|
i0.ɵɵelementStart(3, "button", 11);
|
|
835
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(); });
|
|
836
833
|
i0.ɵɵtext(4, "X");
|
|
837
|
-
i0.ɵɵelementEnd();
|
|
838
|
-
i0.ɵɵelementEnd();
|
|
834
|
+
i0.ɵɵelementEnd()();
|
|
839
835
|
} if (rf & 2) {
|
|
840
836
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
841
837
|
i0.ɵɵadvance(2);
|
|
842
838
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
|
843
839
|
} }
|
|
844
840
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
845
|
-
constructor(
|
|
841
|
+
constructor(componentFactoryResolver) {
|
|
846
842
|
super();
|
|
847
|
-
this.injector = injector;
|
|
848
843
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
849
844
|
this.ModalComp = null;
|
|
850
845
|
this.ModalCompParameters = {};
|
|
@@ -865,7 +860,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
865
860
|
return comp.FormName();
|
|
866
861
|
}
|
|
867
862
|
else
|
|
868
|
-
return
|
|
863
|
+
return '';
|
|
869
864
|
}
|
|
870
865
|
getStyle() {
|
|
871
866
|
let styles = {};
|
|
@@ -874,11 +869,11 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
874
869
|
styles['width'] = comp.Width();
|
|
875
870
|
styles['height'] = comp.Height();
|
|
876
871
|
if (comp.IsCenteredToWindow()) {
|
|
877
|
-
styles['margin'] =
|
|
872
|
+
styles['margin'] = 'auto';
|
|
878
873
|
}
|
|
879
874
|
else {
|
|
880
|
-
styles['margin-left'] = comp.X() +
|
|
881
|
-
styles['margin-top'] = comp.Y() +
|
|
875
|
+
styles['margin-left'] = comp.X() + 'px';
|
|
876
|
+
styles['margin-top'] = comp.Y() + 'px';
|
|
882
877
|
}
|
|
883
878
|
}
|
|
884
879
|
return styles;
|
|
@@ -886,15 +881,14 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
886
881
|
getClientAreaStyles() {
|
|
887
882
|
let styles = {};
|
|
888
883
|
if (this.componentRef != undefined) {
|
|
889
|
-
let comp = this.componentRef.instance;
|
|
890
884
|
const headerHeight = this.getShowTitleBar() && !isNullOrUndefined(this.headerElementRef) ? (this.headerElementRef.nativeElement.offsetHeight + 1) : 0;
|
|
891
885
|
if (!isNullOrUndefined(this.foregroundElementRef)) {
|
|
892
886
|
const foregroundHeight = this.foregroundElementRef.nativeElement.offsetHeight;
|
|
893
|
-
styles['height'] = (foregroundHeight - headerHeight) +
|
|
887
|
+
styles['height'] = (foregroundHeight - headerHeight) + 'px';
|
|
894
888
|
const foregroundWidth = this.foregroundElementRef.nativeElement.offsetWidth;
|
|
895
|
-
styles['width'] = (foregroundWidth) +
|
|
889
|
+
styles['width'] = (foregroundWidth) + 'px';
|
|
896
890
|
}
|
|
897
|
-
styles['overflow'] =
|
|
891
|
+
styles['overflow'] = 'auto';
|
|
898
892
|
}
|
|
899
893
|
return styles;
|
|
900
894
|
}
|
|
@@ -913,7 +907,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
913
907
|
this.OnClose();
|
|
914
908
|
}
|
|
915
909
|
}
|
|
916
|
-
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.
|
|
910
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
917
911
|
MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
|
918
912
|
i0.ɵɵviewQuery(_c0$3, 5);
|
|
919
913
|
i0.ɵɵviewQuery(_c1$1, 5);
|
|
@@ -922,8 +916,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
922
916
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerElementRef = _t.first);
|
|
923
917
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.foregroundElementRef = _t.first);
|
|
924
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) {
|
|
925
|
-
i0.ɵɵelementStart(0, "div");
|
|
926
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
919
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0);
|
|
927
920
|
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
|
|
928
921
|
i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button", 1);
|
|
929
922
|
i0.ɵɵelementEnd();
|
|
@@ -931,9 +924,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
931
924
|
i0.ɵɵtemplate(5, MagicOverlayContainer_div_5_Template, 5, 1, "div", 4);
|
|
932
925
|
i0.ɵɵelementStart(6, "div", 5);
|
|
933
926
|
i0.ɵɵelement(7, "div", 6, 7);
|
|
934
|
-
i0.ɵɵelementEnd();
|
|
935
|
-
i0.ɵɵelementEnd();
|
|
936
|
-
i0.ɵɵelementEnd();
|
|
927
|
+
i0.ɵɵelementEnd()()();
|
|
937
928
|
} if (rf & 2) {
|
|
938
929
|
i0.ɵɵadvance(2);
|
|
939
930
|
i0.ɵɵproperty("ngIf", !ctx.getShowTitleBar());
|
|
@@ -963,7 +954,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
963
954
|
</div>
|
|
964
955
|
</div>
|
|
965
956
|
`, 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.
|
|
957
|
+
}], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
|
|
967
958
|
type: ViewChild,
|
|
968
959
|
args: ['modalheader', { static: false }]
|
|
969
960
|
}], foregroundElementRef: [{
|
|
@@ -1181,9 +1172,7 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
|
1181
1172
|
}
|
|
1182
1173
|
MagicAlertComponent.ɵfac = function () { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(t) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(t || MagicAlertComponent); }; }();
|
|
1183
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) {
|
|
1184
|
-
i0.ɵɵelementStart(0, "div");
|
|
1185
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
1186
|
-
i0.ɵɵelementStart(2, "h2");
|
|
1175
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
|
1187
1176
|
i0.ɵɵtext(3);
|
|
1188
1177
|
i0.ɵɵelementEnd();
|
|
1189
1178
|
i0.ɵɵelementStart(4, "p");
|
|
@@ -1192,9 +1181,7 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
|
|
|
1192
1181
|
i0.ɵɵelementStart(6, "button", 1);
|
|
1193
1182
|
i0.ɵɵlistener("click", function MagicAlertComponent_Template_button_click_6_listener() { return ctx.OnClose(); });
|
|
1194
1183
|
i0.ɵɵtext(7, "OK");
|
|
1195
|
-
i0.ɵɵelementEnd();
|
|
1196
|
-
i0.ɵɵelementEnd();
|
|
1197
|
-
i0.ɵɵelementEnd();
|
|
1184
|
+
i0.ɵɵelementEnd()()();
|
|
1198
1185
|
} if (rf & 2) {
|
|
1199
1186
|
i0.ɵɵadvance(3);
|
|
1200
1187
|
i0.ɵɵtextInterpolate1(" ", ctx.title, "");
|
|
@@ -1249,14 +1236,11 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
|
1249
1236
|
}
|
|
1250
1237
|
MagicConfirmationBoxComponent.ɵfac = function () { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(t) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(t || MagicConfirmationBoxComponent); }; }();
|
|
1251
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) {
|
|
1252
|
-
i0.ɵɵelementStart(0, "div");
|
|
1253
|
-
i0.ɵɵelementStart(1, "div", 0);
|
|
1254
|
-
i0.ɵɵelementStart(2, "h2");
|
|
1239
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
|
1255
1240
|
i0.ɵɵtext(3);
|
|
1256
1241
|
i0.ɵɵelementEnd();
|
|
1257
1242
|
i0.ɵɵtext(4);
|
|
1258
|
-
i0.ɵɵelement(5, "br");
|
|
1259
|
-
i0.ɵɵelement(6, "br");
|
|
1243
|
+
i0.ɵɵelement(5, "br")(6, "br");
|
|
1260
1244
|
i0.ɵɵelementStart(7, "button", 1);
|
|
1261
1245
|
i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_7_listener() { return ctx.OnClose(true); });
|
|
1262
1246
|
i0.ɵɵtext(8, "OK");
|
|
@@ -1264,9 +1248,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
|
|
|
1264
1248
|
i0.ɵɵelementStart(9, "button", 2);
|
|
1265
1249
|
i0.ɵɵlistener("click", function MagicConfirmationBoxComponent_Template_button_click_9_listener() { return ctx.OnClose(false); });
|
|
1266
1250
|
i0.ɵɵtext(10, "Cancel");
|
|
1267
|
-
i0.ɵɵelementEnd();
|
|
1268
|
-
i0.ɵɵelementEnd();
|
|
1269
|
-
i0.ɵɵelementEnd();
|
|
1251
|
+
i0.ɵɵelementEnd()()();
|
|
1270
1252
|
} if (rf & 2) {
|
|
1271
1253
|
i0.ɵɵadvance(3);
|
|
1272
1254
|
i0.ɵɵtextInterpolate1(" ", ctx.title, "");
|
|
@@ -1370,7 +1352,6 @@ class confirmationBox {
|
|
|
1370
1352
|
}
|
|
1371
1353
|
static showConfirmationBox(title, message, style) {
|
|
1372
1354
|
let okWasPressed = false;
|
|
1373
|
-
let retValue = Styles.MSGBOX_RESULT_OK;
|
|
1374
1355
|
let isConfirm = this.isConfirmBox(style);
|
|
1375
1356
|
let titleAndString = title + '\n' + '\n' + message;
|
|
1376
1357
|
if (isConfirm)
|
|
@@ -2252,15 +2233,30 @@ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, f
|
|
|
2252
2233
|
type: Injectable
|
|
2253
2234
|
}], function () { return [{ type: i1$1.Title }]; }, null); })();
|
|
2254
2235
|
|
|
2236
|
+
let COLOR_FILE_NAME = new InjectionToken('colorFile', {
|
|
2237
|
+
providedIn: 'root',
|
|
2238
|
+
factory: () => 'clr_rnt.eng'
|
|
2239
|
+
});
|
|
2255
2240
|
const MAGIC_FG_COLOR = 1;
|
|
2256
2241
|
const MAGIC_BG_COLOR = 2;
|
|
2257
2242
|
class MagicColorService {
|
|
2258
|
-
constructor(http) {
|
|
2243
|
+
constructor(http, colorFile1 = 'clr_rnt.eng') {
|
|
2259
2244
|
this.http = http;
|
|
2260
|
-
this.
|
|
2261
|
-
|
|
2262
|
-
this.
|
|
2263
|
-
|
|
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
|
+
}
|
|
2264
2260
|
}
|
|
2265
2261
|
hexToRgba(hex) {
|
|
2266
2262
|
let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
@@ -2277,35 +2273,44 @@ 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
|
|
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 = (
|
|
2285
|
+
hex = (color[1]);
|
|
2288
2286
|
break;
|
|
2289
2287
|
case MAGIC_BG_COLOR:
|
|
2290
|
-
hex = (
|
|
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
|
}
|
|
2301
|
-
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)); };
|
|
2302
2304
|
MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
|
2303
2305
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
|
2304
2306
|
type: Injectable,
|
|
2305
2307
|
args: [{
|
|
2306
2308
|
providedIn: 'root'
|
|
2307
2309
|
}]
|
|
2308
|
-
}], 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); })();
|
|
2309
2314
|
|
|
2310
2315
|
class AccessorMagicService {
|
|
2311
2316
|
constructor(task, magicColor) {
|
|
@@ -2649,7 +2654,7 @@ class TaskBaseMagicComponent {
|
|
|
2649
2654
|
return this.task.ScreenModeControls;
|
|
2650
2655
|
}
|
|
2651
2656
|
ngOnInit() {
|
|
2652
|
-
|
|
2657
|
+
this.task.detectChanges.pipe().subscribe(c => {
|
|
2653
2658
|
this.ref.detectChanges();
|
|
2654
2659
|
});
|
|
2655
2660
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
@@ -2958,7 +2963,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
2958
2963
|
}
|
|
2959
2964
|
if (this.isRadio()) {
|
|
2960
2965
|
this.htmlElement.addEventListener('change', (e) => {
|
|
2961
|
-
let result = this.task.getFormControl('0', this.id);
|
|
2962
2966
|
let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
|
|
2963
2967
|
guiEvent.Value = (e.target).value;
|
|
2964
2968
|
this.task.insertEvent(guiEvent);
|
|
@@ -3313,7 +3317,7 @@ class MgformatMagicDirective {
|
|
|
3313
3317
|
}
|
|
3314
3318
|
}
|
|
3315
3319
|
generatePattern(attribute, pic) {
|
|
3316
|
-
let pattern =
|
|
3320
|
+
let pattern = '';
|
|
3317
3321
|
switch (attribute) {
|
|
3318
3322
|
case StorageAttribute.NUMERIC:
|
|
3319
3323
|
pattern = this.generatePatternForNumber(pic);
|
|
@@ -3327,14 +3331,14 @@ class MgformatMagicDirective {
|
|
|
3327
3331
|
}
|
|
3328
3332
|
generatePatternForNumber(pic) {
|
|
3329
3333
|
let patternStr = new StringBuilder();
|
|
3330
|
-
patternStr.Append(
|
|
3334
|
+
patternStr.Append('^');
|
|
3331
3335
|
if (pic.isNegative())
|
|
3332
|
-
patternStr.Append(
|
|
3336
|
+
patternStr.Append('-?');
|
|
3333
3337
|
if (pic.getWholes())
|
|
3334
|
-
patternStr.AppendFormat(
|
|
3338
|
+
patternStr.AppendFormat('\\d{{0},{1}}', 0, pic.getWholes());
|
|
3335
3339
|
if (pic.getDec())
|
|
3336
|
-
patternStr.AppendFormat(
|
|
3337
|
-
patternStr.Append(
|
|
3340
|
+
patternStr.AppendFormat('(\\.\\d{1,{0}})?', pic.getDec());
|
|
3341
|
+
patternStr.Append('$');
|
|
3338
3342
|
return patternStr.ToString();
|
|
3339
3343
|
}
|
|
3340
3344
|
isPatternGenerationNeeded(attr, pic) {
|
|
@@ -3350,15 +3354,13 @@ class MgformatMagicDirective {
|
|
|
3350
3354
|
let cnt = 0;
|
|
3351
3355
|
let inputAllChars = false;
|
|
3352
3356
|
let closeSet = false;
|
|
3353
|
-
let val = null;
|
|
3354
|
-
let allowMulitiline = false;
|
|
3355
3357
|
let mask = pic.getMask();
|
|
3356
3358
|
let pattern = new StringBuilder();
|
|
3357
|
-
pattern.Append(
|
|
3359
|
+
pattern.Append('^');
|
|
3358
3360
|
for (let i = 0; i < mask.length;) {
|
|
3359
3361
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
|
3360
3362
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
|
3361
|
-
pattern.Append(
|
|
3363
|
+
pattern.Append('(');
|
|
3362
3364
|
closeSet = true;
|
|
3363
3365
|
inputAllChars = false;
|
|
3364
3366
|
}
|
|
@@ -3368,7 +3370,7 @@ class MgformatMagicDirective {
|
|
|
3368
3370
|
case PICInterface.PIC_X:
|
|
3369
3371
|
case PICInterface.PIC_L:
|
|
3370
3372
|
{
|
|
3371
|
-
pattern.Append(
|
|
3373
|
+
pattern.Append('.');
|
|
3372
3374
|
let inputAllCharsRef = new RefParam(false);
|
|
3373
3375
|
let dirs = PICInterface.PIC_U.toString();
|
|
3374
3376
|
dirs += PICInterface.PIC_L.toString();
|
|
@@ -3380,7 +3382,7 @@ class MgformatMagicDirective {
|
|
|
3380
3382
|
break;
|
|
3381
3383
|
case PICInterface.PIC_N:
|
|
3382
3384
|
{
|
|
3383
|
-
pattern.Append(
|
|
3385
|
+
pattern.Append('\\d');
|
|
3384
3386
|
let inputAllCharsRef = new RefParam(false);
|
|
3385
3387
|
cnt = this.getDirectiveCount(mask, i, PICInterface.PIC_L.toString(), inputAllCharsRef);
|
|
3386
3388
|
inputAllChars = inputAllCharsRef.value;
|
|
@@ -3393,12 +3395,12 @@ class MgformatMagicDirective {
|
|
|
3393
3395
|
break;
|
|
3394
3396
|
}
|
|
3395
3397
|
if (cnt > 0)
|
|
3396
|
-
pattern.AppendFormat(
|
|
3398
|
+
pattern.AppendFormat('{{0},{1}}', inputAllChars ? cnt : 0, cnt);
|
|
3397
3399
|
if (closeSet)
|
|
3398
|
-
pattern.Append(
|
|
3400
|
+
pattern.Append(')');
|
|
3399
3401
|
closeSet = false;
|
|
3400
3402
|
}
|
|
3401
|
-
pattern.Append(
|
|
3403
|
+
pattern.Append('$');
|
|
3402
3404
|
return pattern.ToString();
|
|
3403
3405
|
}
|
|
3404
3406
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
|
@@ -3589,8 +3591,7 @@ function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
3589
3591
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.mgService.getErrMsg(ctx_r2.id, ctx_r2.rowId), " ");
|
|
3590
3592
|
} }
|
|
3591
3593
|
function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
3592
|
-
i0.ɵɵelementStart(0, "div");
|
|
3593
|
-
i0.ɵɵelementStart(1, "div", null, 1);
|
|
3594
|
+
i0.ɵɵelementStart(0, "div")(1, "div", null, 1);
|
|
3594
3595
|
i0.ɵɵprojection(3);
|
|
3595
3596
|
i0.ɵɵelementEnd();
|
|
3596
3597
|
i0.ɵɵtemplate(4, ErrorMagicComponent_div_0_span_4_Template, 2, 1, "span", 0);
|
|
@@ -4132,11 +4133,10 @@ class NonMagicControlDirective {
|
|
|
4132
4133
|
regEvents() {
|
|
4133
4134
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
4134
4135
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
4135
|
-
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
4136
4136
|
});
|
|
4137
4137
|
}
|
|
4138
4138
|
OnFocus() {
|
|
4139
|
-
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl',
|
|
4139
|
+
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
|
|
4140
4140
|
event.cancelBubble = true;
|
|
4141
4141
|
}
|
|
4142
4142
|
ngOnInit() {
|
|
@@ -4293,7 +4293,7 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4293
4293
|
}
|
|
4294
4294
|
parse(value) {
|
|
4295
4295
|
let valueStr = value;
|
|
4296
|
-
let date = 0, month = 0, year = 0
|
|
4296
|
+
let date = 0, month = 0, year = 0;
|
|
4297
4297
|
let mgDateMask = this.mgdtfmt;
|
|
4298
4298
|
let sep = valueStr.indexOf('/') > 0 ? '/' : '-';
|
|
4299
4299
|
if (value == null || value == "")
|
|
@@ -4302,9 +4302,8 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4302
4302
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
4303
4303
|
if ((this.mgdtfmt.indexOf('MMM') > 0) || (this.mgdtfmt.indexOf('MMMM') > 0))
|
|
4304
4304
|
return new Date(value);
|
|
4305
|
-
let vallen = valueStr.length;
|
|
4306
4305
|
if (mgDateMask !== null) {
|
|
4307
|
-
for (let i = 0
|
|
4306
|
+
for (let i = 0; i < mgDateMask.length;) {
|
|
4308
4307
|
switch (mgDateMask[i]) {
|
|
4309
4308
|
case 'd':
|
|
4310
4309
|
{
|
|
@@ -4390,14 +4389,6 @@ const magicProviders = [
|
|
|
4390
4389
|
];
|
|
4391
4390
|
|
|
4392
4391
|
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
4392
|
static getDistance(control, x, y) {
|
|
4402
4393
|
let left = control.clientLeft, top = control.clientTop;
|
|
4403
4394
|
let dx, dy;
|
|
@@ -4459,5 +4450,5 @@ class ModalFormDefinition {
|
|
|
4459
4450
|
}
|
|
4460
4451
|
}
|
|
4461
4452
|
|
|
4462
|
-
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 };
|
|
4463
4454
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|