@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
|
@@ -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(
|
|
495
|
-
moduleName = moduleName.replace(
|
|
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 =
|
|
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(
|
|
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
|
|
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)
|
|
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 }
|
|
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)
|
|
@@ -1109,9 +1105,8 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) {
|
|
|
1109
1105
|
}
|
|
1110
1106
|
}
|
|
1111
1107
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
1112
|
-
constructor(
|
|
1108
|
+
constructor(componentFactoryResolver) {
|
|
1113
1109
|
super();
|
|
1114
|
-
this.injector = injector;
|
|
1115
1110
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1116
1111
|
this.ModalComp = null;
|
|
1117
1112
|
this.ModalCompParameters = {};
|
|
@@ -1132,7 +1127,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1132
1127
|
return comp.FormName();
|
|
1133
1128
|
}
|
|
1134
1129
|
else
|
|
1135
|
-
return
|
|
1130
|
+
return '';
|
|
1136
1131
|
}
|
|
1137
1132
|
getStyle() {
|
|
1138
1133
|
let styles = {};
|
|
@@ -1141,11 +1136,11 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1141
1136
|
styles['width'] = comp.Width();
|
|
1142
1137
|
styles['height'] = comp.Height();
|
|
1143
1138
|
if (comp.IsCenteredToWindow()) {
|
|
1144
|
-
styles['margin'] =
|
|
1139
|
+
styles['margin'] = 'auto';
|
|
1145
1140
|
}
|
|
1146
1141
|
else {
|
|
1147
|
-
styles['margin-left'] = comp.X() +
|
|
1148
|
-
styles['margin-top'] = comp.Y() +
|
|
1142
|
+
styles['margin-left'] = comp.X() + 'px';
|
|
1143
|
+
styles['margin-top'] = comp.Y() + 'px';
|
|
1149
1144
|
}
|
|
1150
1145
|
}
|
|
1151
1146
|
return styles;
|
|
@@ -1153,15 +1148,14 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1153
1148
|
getClientAreaStyles() {
|
|
1154
1149
|
let styles = {};
|
|
1155
1150
|
if (this.componentRef != undefined) {
|
|
1156
|
-
let comp = this.componentRef.instance;
|
|
1157
1151
|
const headerHeight = this.getShowTitleBar() && !isNullOrUndefined(this.headerElementRef) ? (this.headerElementRef.nativeElement.offsetHeight + 1) : 0;
|
|
1158
1152
|
if (!isNullOrUndefined(this.foregroundElementRef)) {
|
|
1159
1153
|
const foregroundHeight = this.foregroundElementRef.nativeElement.offsetHeight;
|
|
1160
|
-
styles['height'] = (foregroundHeight - headerHeight) +
|
|
1154
|
+
styles['height'] = (foregroundHeight - headerHeight) + 'px';
|
|
1161
1155
|
const foregroundWidth = this.foregroundElementRef.nativeElement.offsetWidth;
|
|
1162
|
-
styles['width'] = (foregroundWidth) +
|
|
1156
|
+
styles['width'] = (foregroundWidth) + 'px';
|
|
1163
1157
|
}
|
|
1164
|
-
styles['overflow'] =
|
|
1158
|
+
styles['overflow'] = 'auto';
|
|
1165
1159
|
}
|
|
1166
1160
|
return styles;
|
|
1167
1161
|
}
|
|
@@ -1180,7 +1174,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1180
1174
|
this.OnClose();
|
|
1181
1175
|
}
|
|
1182
1176
|
}
|
|
1183
|
-
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.
|
|
1177
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
1184
1178
|
MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
|
|
1185
1179
|
if (rf & 1) {
|
|
1186
1180
|
i0.ɵɵviewQuery(_c0$2, 5);
|
|
@@ -1237,7 +1231,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
|
1237
1231
|
</div>
|
|
1238
1232
|
</div>
|
|
1239
1233
|
`, 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.
|
|
1234
|
+
}], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
|
|
1241
1235
|
type: ViewChild,
|
|
1242
1236
|
args: ['modalheader', { static: false }]
|
|
1243
1237
|
}], foregroundElementRef: [{
|
|
@@ -2721,7 +2715,7 @@ class TaskBaseMagicComponent {
|
|
|
2721
2715
|
return this.task.ScreenModeControls;
|
|
2722
2716
|
}
|
|
2723
2717
|
ngOnInit() {
|
|
2724
|
-
|
|
2718
|
+
this.task.detectChanges.pipe().subscribe(c => {
|
|
2725
2719
|
this.ref.detectChanges();
|
|
2726
2720
|
});
|
|
2727
2721
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
@@ -3040,7 +3034,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3040
3034
|
}
|
|
3041
3035
|
if (this.isRadio()) {
|
|
3042
3036
|
this.htmlElement.addEventListener('change', (e) => {
|
|
3043
|
-
let result = this.task.getFormControl('0', this.id);
|
|
3044
3037
|
let guiEvent = getGuiEventObj("selectionchanged", this.id, 0);
|
|
3045
3038
|
guiEvent.Value = (e.target).value;
|
|
3046
3039
|
this.task.insertEvent(guiEvent);
|
|
@@ -3401,7 +3394,7 @@ class MgformatMagicDirective {
|
|
|
3401
3394
|
}
|
|
3402
3395
|
}
|
|
3403
3396
|
generatePattern(attribute, pic) {
|
|
3404
|
-
let pattern =
|
|
3397
|
+
let pattern = '';
|
|
3405
3398
|
switch (attribute) {
|
|
3406
3399
|
case StorageAttribute.NUMERIC:
|
|
3407
3400
|
pattern = this.generatePatternForNumber(pic);
|
|
@@ -3415,14 +3408,14 @@ class MgformatMagicDirective {
|
|
|
3415
3408
|
}
|
|
3416
3409
|
generatePatternForNumber(pic) {
|
|
3417
3410
|
let patternStr = new StringBuilder();
|
|
3418
|
-
patternStr.Append(
|
|
3411
|
+
patternStr.Append('^');
|
|
3419
3412
|
if (pic.isNegative())
|
|
3420
|
-
patternStr.Append(
|
|
3413
|
+
patternStr.Append('-?');
|
|
3421
3414
|
if (pic.getWholes())
|
|
3422
|
-
patternStr.AppendFormat(
|
|
3415
|
+
patternStr.AppendFormat('\\d{{0},{1}}', 0, pic.getWholes());
|
|
3423
3416
|
if (pic.getDec())
|
|
3424
|
-
patternStr.AppendFormat(
|
|
3425
|
-
patternStr.Append(
|
|
3417
|
+
patternStr.AppendFormat('(\\.\\d{1,{0}})?', pic.getDec());
|
|
3418
|
+
patternStr.Append('$');
|
|
3426
3419
|
return patternStr.ToString();
|
|
3427
3420
|
}
|
|
3428
3421
|
isPatternGenerationNeeded(attr, pic) {
|
|
@@ -3438,15 +3431,13 @@ class MgformatMagicDirective {
|
|
|
3438
3431
|
let cnt = 0;
|
|
3439
3432
|
let inputAllChars = false;
|
|
3440
3433
|
let closeSet = false;
|
|
3441
|
-
let val = null;
|
|
3442
|
-
let allowMulitiline = false;
|
|
3443
3434
|
let mask = pic.getMask();
|
|
3444
3435
|
let pattern = new StringBuilder();
|
|
3445
|
-
pattern.Append(
|
|
3436
|
+
pattern.Append('^');
|
|
3446
3437
|
for (let i = 0; i < mask.length;) {
|
|
3447
3438
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
|
3448
3439
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
|
3449
|
-
pattern.Append(
|
|
3440
|
+
pattern.Append('(');
|
|
3450
3441
|
closeSet = true;
|
|
3451
3442
|
inputAllChars = false;
|
|
3452
3443
|
}
|
|
@@ -3456,7 +3447,7 @@ class MgformatMagicDirective {
|
|
|
3456
3447
|
case PICInterface.PIC_X:
|
|
3457
3448
|
case PICInterface.PIC_L:
|
|
3458
3449
|
{
|
|
3459
|
-
pattern.Append(
|
|
3450
|
+
pattern.Append('.');
|
|
3460
3451
|
let inputAllCharsRef = new RefParam(false);
|
|
3461
3452
|
let dirs = PICInterface.PIC_U.toString();
|
|
3462
3453
|
dirs += PICInterface.PIC_L.toString();
|
|
@@ -3468,7 +3459,7 @@ class MgformatMagicDirective {
|
|
|
3468
3459
|
break;
|
|
3469
3460
|
case PICInterface.PIC_N:
|
|
3470
3461
|
{
|
|
3471
|
-
pattern.Append(
|
|
3462
|
+
pattern.Append('\\d');
|
|
3472
3463
|
let inputAllCharsRef = new RefParam(false);
|
|
3473
3464
|
cnt = this.getDirectiveCount(mask, i, PICInterface.PIC_L.toString(), inputAllCharsRef);
|
|
3474
3465
|
inputAllChars = inputAllCharsRef.value;
|
|
@@ -3481,12 +3472,12 @@ class MgformatMagicDirective {
|
|
|
3481
3472
|
break;
|
|
3482
3473
|
}
|
|
3483
3474
|
if (cnt > 0)
|
|
3484
|
-
pattern.AppendFormat(
|
|
3475
|
+
pattern.AppendFormat('{{0},{1}}', inputAllChars ? cnt : 0, cnt);
|
|
3485
3476
|
if (closeSet)
|
|
3486
|
-
pattern.Append(
|
|
3477
|
+
pattern.Append(')');
|
|
3487
3478
|
closeSet = false;
|
|
3488
3479
|
}
|
|
3489
|
-
pattern.Append(
|
|
3480
|
+
pattern.Append('$');
|
|
3490
3481
|
return pattern.ToString();
|
|
3491
3482
|
}
|
|
3492
3483
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
|
@@ -4300,11 +4291,10 @@ class NonMagicControlDirective {
|
|
|
4300
4291
|
regEvents() {
|
|
4301
4292
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
4302
4293
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
4303
|
-
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
4304
4294
|
});
|
|
4305
4295
|
}
|
|
4306
4296
|
OnFocus() {
|
|
4307
|
-
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl',
|
|
4297
|
+
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
|
|
4308
4298
|
event.cancelBubble = true;
|
|
4309
4299
|
}
|
|
4310
4300
|
ngOnInit() {
|
|
@@ -4467,7 +4457,7 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4467
4457
|
}
|
|
4468
4458
|
parse(value) {
|
|
4469
4459
|
let valueStr = value;
|
|
4470
|
-
let date = 0, month = 0, year = 0
|
|
4460
|
+
let date = 0, month = 0, year = 0;
|
|
4471
4461
|
let mgDateMask = this.mgdtfmt;
|
|
4472
4462
|
let sep = valueStr.indexOf('/') > 0 ? '/' : '-';
|
|
4473
4463
|
if (value == null || value == "")
|
|
@@ -4476,9 +4466,8 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4476
4466
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
4477
4467
|
if ((this.mgdtfmt.indexOf('MMM') > 0) || (this.mgdtfmt.indexOf('MMMM') > 0))
|
|
4478
4468
|
return new Date(value);
|
|
4479
|
-
let vallen = valueStr.length;
|
|
4480
4469
|
if (mgDateMask !== null) {
|
|
4481
|
-
for (let i = 0
|
|
4470
|
+
for (let i = 0; i < mgDateMask.length;) {
|
|
4482
4471
|
switch (mgDateMask[i]) {
|
|
4483
4472
|
case 'd':
|
|
4484
4473
|
{
|
|
@@ -4566,14 +4555,6 @@ const magicProviders = [
|
|
|
4566
4555
|
];
|
|
4567
4556
|
|
|
4568
4557
|
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
4558
|
static getDistance(control, x, y) {
|
|
4578
4559
|
let left = control.clientLeft, top = control.clientTop;
|
|
4579
4560
|
let dx, dy;
|