@magic-xpa/angular 4.801.0-dev481.293 → 4.801.0-dev481.297
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/mg-date-adapter.mjs +3 -4
- package/esm2020/src/services/subform.magic.service.mjs +6 -7
- 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 +12 -14
- 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 +35 -54
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +35 -54
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/package.json +3 -3
- 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
|
@@ -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"];
|
|
@@ -842,9 +839,8 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
842
839
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
|
843
840
|
} }
|
|
844
841
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
845
|
-
constructor(
|
|
842
|
+
constructor(componentFactoryResolver) {
|
|
846
843
|
super();
|
|
847
|
-
this.injector = injector;
|
|
848
844
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
849
845
|
this.ModalComp = null;
|
|
850
846
|
this.ModalCompParameters = {};
|
|
@@ -865,7 +861,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
865
861
|
return comp.FormName();
|
|
866
862
|
}
|
|
867
863
|
else
|
|
868
|
-
return
|
|
864
|
+
return '';
|
|
869
865
|
}
|
|
870
866
|
getStyle() {
|
|
871
867
|
let styles = {};
|
|
@@ -874,11 +870,11 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
874
870
|
styles['width'] = comp.Width();
|
|
875
871
|
styles['height'] = comp.Height();
|
|
876
872
|
if (comp.IsCenteredToWindow()) {
|
|
877
|
-
styles['margin'] =
|
|
873
|
+
styles['margin'] = 'auto';
|
|
878
874
|
}
|
|
879
875
|
else {
|
|
880
|
-
styles['margin-left'] = comp.X() +
|
|
881
|
-
styles['margin-top'] = comp.Y() +
|
|
876
|
+
styles['margin-left'] = comp.X() + 'px';
|
|
877
|
+
styles['margin-top'] = comp.Y() + 'px';
|
|
882
878
|
}
|
|
883
879
|
}
|
|
884
880
|
return styles;
|
|
@@ -886,15 +882,14 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
886
882
|
getClientAreaStyles() {
|
|
887
883
|
let styles = {};
|
|
888
884
|
if (this.componentRef != undefined) {
|
|
889
|
-
let comp = this.componentRef.instance;
|
|
890
885
|
const headerHeight = this.getShowTitleBar() && !isNullOrUndefined(this.headerElementRef) ? (this.headerElementRef.nativeElement.offsetHeight + 1) : 0;
|
|
891
886
|
if (!isNullOrUndefined(this.foregroundElementRef)) {
|
|
892
887
|
const foregroundHeight = this.foregroundElementRef.nativeElement.offsetHeight;
|
|
893
|
-
styles['height'] = (foregroundHeight - headerHeight) +
|
|
888
|
+
styles['height'] = (foregroundHeight - headerHeight) + 'px';
|
|
894
889
|
const foregroundWidth = this.foregroundElementRef.nativeElement.offsetWidth;
|
|
895
|
-
styles['width'] = (foregroundWidth) +
|
|
890
|
+
styles['width'] = (foregroundWidth) + 'px';
|
|
896
891
|
}
|
|
897
|
-
styles['overflow'] =
|
|
892
|
+
styles['overflow'] = 'auto';
|
|
898
893
|
}
|
|
899
894
|
return styles;
|
|
900
895
|
}
|
|
@@ -913,7 +908,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
913
908
|
this.OnClose();
|
|
914
909
|
}
|
|
915
910
|
}
|
|
916
|
-
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.
|
|
911
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
917
912
|
MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
|
918
913
|
i0.ɵɵviewQuery(_c0$3, 5);
|
|
919
914
|
i0.ɵɵviewQuery(_c1$1, 5);
|
|
@@ -963,7 +958,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
963
958
|
</div>
|
|
964
959
|
</div>
|
|
965
960
|
`, styles: [".modal-foreground{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#fff}.modal-background{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
|
|
966
|
-
}], function () { return [{ type: i0.
|
|
961
|
+
}], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
|
|
967
962
|
type: ViewChild,
|
|
968
963
|
args: ['modalheader', { static: false }]
|
|
969
964
|
}], foregroundElementRef: [{
|
|
@@ -1370,7 +1365,6 @@ class confirmationBox {
|
|
|
1370
1365
|
}
|
|
1371
1366
|
static showConfirmationBox(title, message, style) {
|
|
1372
1367
|
let okWasPressed = false;
|
|
1373
|
-
let retValue = Styles.MSGBOX_RESULT_OK;
|
|
1374
1368
|
let isConfirm = this.isConfirmBox(style);
|
|
1375
1369
|
let titleAndString = title + '\n' + '\n' + message;
|
|
1376
1370
|
if (isConfirm)
|
|
@@ -2649,7 +2643,7 @@ class TaskBaseMagicComponent {
|
|
|
2649
2643
|
return this.task.ScreenModeControls;
|
|
2650
2644
|
}
|
|
2651
2645
|
ngOnInit() {
|
|
2652
|
-
|
|
2646
|
+
this.task.detectChanges.pipe().subscribe(c => {
|
|
2653
2647
|
this.ref.detectChanges();
|
|
2654
2648
|
});
|
|
2655
2649
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
@@ -2958,7 +2952,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
2958
2952
|
}
|
|
2959
2953
|
if (this.isRadio()) {
|
|
2960
2954
|
this.htmlElement.addEventListener('change', (e) => {
|
|
2961
|
-
let result = this.task.getFormControl('0', this.id);
|
|
2962
2955
|
let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
|
|
2963
2956
|
guiEvent.Value = (e.target).value;
|
|
2964
2957
|
this.task.insertEvent(guiEvent);
|
|
@@ -3313,7 +3306,7 @@ class MgformatMagicDirective {
|
|
|
3313
3306
|
}
|
|
3314
3307
|
}
|
|
3315
3308
|
generatePattern(attribute, pic) {
|
|
3316
|
-
let pattern =
|
|
3309
|
+
let pattern = '';
|
|
3317
3310
|
switch (attribute) {
|
|
3318
3311
|
case StorageAttribute.NUMERIC:
|
|
3319
3312
|
pattern = this.generatePatternForNumber(pic);
|
|
@@ -3327,14 +3320,14 @@ class MgformatMagicDirective {
|
|
|
3327
3320
|
}
|
|
3328
3321
|
generatePatternForNumber(pic) {
|
|
3329
3322
|
let patternStr = new StringBuilder();
|
|
3330
|
-
patternStr.Append(
|
|
3323
|
+
patternStr.Append('^');
|
|
3331
3324
|
if (pic.isNegative())
|
|
3332
|
-
patternStr.Append(
|
|
3325
|
+
patternStr.Append('-?');
|
|
3333
3326
|
if (pic.getWholes())
|
|
3334
|
-
patternStr.AppendFormat(
|
|
3327
|
+
patternStr.AppendFormat('\\d{{0},{1}}', 0, pic.getWholes());
|
|
3335
3328
|
if (pic.getDec())
|
|
3336
|
-
patternStr.AppendFormat(
|
|
3337
|
-
patternStr.Append(
|
|
3329
|
+
patternStr.AppendFormat('(\\.\\d{1,{0}})?', pic.getDec());
|
|
3330
|
+
patternStr.Append('$');
|
|
3338
3331
|
return patternStr.ToString();
|
|
3339
3332
|
}
|
|
3340
3333
|
isPatternGenerationNeeded(attr, pic) {
|
|
@@ -3350,15 +3343,13 @@ class MgformatMagicDirective {
|
|
|
3350
3343
|
let cnt = 0;
|
|
3351
3344
|
let inputAllChars = false;
|
|
3352
3345
|
let closeSet = false;
|
|
3353
|
-
let val = null;
|
|
3354
|
-
let allowMulitiline = false;
|
|
3355
3346
|
let mask = pic.getMask();
|
|
3356
3347
|
let pattern = new StringBuilder();
|
|
3357
|
-
pattern.Append(
|
|
3348
|
+
pattern.Append('^');
|
|
3358
3349
|
for (let i = 0; i < mask.length;) {
|
|
3359
3350
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
|
3360
3351
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
|
3361
|
-
pattern.Append(
|
|
3352
|
+
pattern.Append('(');
|
|
3362
3353
|
closeSet = true;
|
|
3363
3354
|
inputAllChars = false;
|
|
3364
3355
|
}
|
|
@@ -3368,7 +3359,7 @@ class MgformatMagicDirective {
|
|
|
3368
3359
|
case PICInterface.PIC_X:
|
|
3369
3360
|
case PICInterface.PIC_L:
|
|
3370
3361
|
{
|
|
3371
|
-
pattern.Append(
|
|
3362
|
+
pattern.Append('.');
|
|
3372
3363
|
let inputAllCharsRef = new RefParam(false);
|
|
3373
3364
|
let dirs = PICInterface.PIC_U.toString();
|
|
3374
3365
|
dirs += PICInterface.PIC_L.toString();
|
|
@@ -3380,7 +3371,7 @@ class MgformatMagicDirective {
|
|
|
3380
3371
|
break;
|
|
3381
3372
|
case PICInterface.PIC_N:
|
|
3382
3373
|
{
|
|
3383
|
-
pattern.Append(
|
|
3374
|
+
pattern.Append('\\d');
|
|
3384
3375
|
let inputAllCharsRef = new RefParam(false);
|
|
3385
3376
|
cnt = this.getDirectiveCount(mask, i, PICInterface.PIC_L.toString(), inputAllCharsRef);
|
|
3386
3377
|
inputAllChars = inputAllCharsRef.value;
|
|
@@ -3393,12 +3384,12 @@ class MgformatMagicDirective {
|
|
|
3393
3384
|
break;
|
|
3394
3385
|
}
|
|
3395
3386
|
if (cnt > 0)
|
|
3396
|
-
pattern.AppendFormat(
|
|
3387
|
+
pattern.AppendFormat('{{0},{1}}', inputAllChars ? cnt : 0, cnt);
|
|
3397
3388
|
if (closeSet)
|
|
3398
|
-
pattern.Append(
|
|
3389
|
+
pattern.Append(')');
|
|
3399
3390
|
closeSet = false;
|
|
3400
3391
|
}
|
|
3401
|
-
pattern.Append(
|
|
3392
|
+
pattern.Append('$');
|
|
3402
3393
|
return pattern.ToString();
|
|
3403
3394
|
}
|
|
3404
3395
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
|
@@ -4132,11 +4123,10 @@ class NonMagicControlDirective {
|
|
|
4132
4123
|
regEvents() {
|
|
4133
4124
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
4134
4125
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
4135
|
-
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
4136
4126
|
});
|
|
4137
4127
|
}
|
|
4138
4128
|
OnFocus() {
|
|
4139
|
-
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl',
|
|
4129
|
+
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
|
|
4140
4130
|
event.cancelBubble = true;
|
|
4141
4131
|
}
|
|
4142
4132
|
ngOnInit() {
|
|
@@ -4293,7 +4283,7 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4293
4283
|
}
|
|
4294
4284
|
parse(value) {
|
|
4295
4285
|
let valueStr = value;
|
|
4296
|
-
let date = 0, month = 0, year = 0
|
|
4286
|
+
let date = 0, month = 0, year = 0;
|
|
4297
4287
|
let mgDateMask = this.mgdtfmt;
|
|
4298
4288
|
let sep = valueStr.indexOf('/') > 0 ? '/' : '-';
|
|
4299
4289
|
if (value == null || value == "")
|
|
@@ -4302,9 +4292,8 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4302
4292
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
4303
4293
|
if ((this.mgdtfmt.indexOf('MMM') > 0) || (this.mgdtfmt.indexOf('MMMM') > 0))
|
|
4304
4294
|
return new Date(value);
|
|
4305
|
-
let vallen = valueStr.length;
|
|
4306
4295
|
if (mgDateMask !== null) {
|
|
4307
|
-
for (let i = 0
|
|
4296
|
+
for (let i = 0; i < mgDateMask.length;) {
|
|
4308
4297
|
switch (mgDateMask[i]) {
|
|
4309
4298
|
case 'd':
|
|
4310
4299
|
{
|
|
@@ -4390,14 +4379,6 @@ const magicProviders = [
|
|
|
4390
4379
|
];
|
|
4391
4380
|
|
|
4392
4381
|
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
4382
|
static getDistance(control, x, y) {
|
|
4402
4383
|
let left = control.clientLeft, top = control.clientTop;
|
|
4403
4384
|
let dx, dy;
|