@magic-xpa/angular 4.801.6 → 4.900.0-dev490.101
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 +2 -2
- package/esm2020/src/services/task.magics.service.mjs +1 -1
- package/esm2020/src/ui/directives/magic.directive.mjs +9 -9
- package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +26 -19
- package/fesm2015/magic-xpa-angular.mjs +33 -26
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +33 -26
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/package.json +3 -3
- package/src/ui/directives/mgformat.magic.directive.d.ts +2 -0
@@ -2552,7 +2552,7 @@ class AccessorMagicService {
|
|
2552
2552
|
if (c.hasError('maxlength'))
|
2553
2553
|
return 'Max length allowed is : ' + c.errors.maxlength.requiredLength;
|
2554
2554
|
if (c.hasError('max'))
|
2555
|
-
return 'Max value
|
2555
|
+
return 'Max value allowed is : ' + c.errors.max.max;
|
2556
2556
|
let controlMetadata = this.task.Records.list[rowId].getControlMetadata(id);
|
2557
2557
|
for (let key of controlMetadata.customValidators.keys()) {
|
2558
2558
|
if (c.hasError(key)) {
|
@@ -2929,15 +2929,15 @@ class MagicDirective {
|
|
2929
2929
|
}
|
2930
2930
|
handleSetProperty(command) {
|
2931
2931
|
switch (command.Operation) {
|
2932
|
-
case HtmlProperties.ReadOnly:
|
2933
|
-
|
2934
|
-
if (command.
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2932
|
+
case HtmlProperties.ReadOnly:
|
2933
|
+
{
|
2934
|
+
if (command.obj.Type == MgControlType.CTRL_TYPE_TEXT)
|
2935
|
+
if (command.obj1 != true)
|
2936
|
+
this.renderer.removeAttribute(this.htmlElement, command.Operation);
|
2937
|
+
else
|
2938
|
+
this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
|
2938
2939
|
}
|
2939
2940
|
break;
|
2940
|
-
}
|
2941
2941
|
}
|
2942
2942
|
}
|
2943
2943
|
ngOnDestroy() {
|
@@ -3258,6 +3258,25 @@ class MgformatMagicDirective {
|
|
3258
3258
|
}
|
3259
3259
|
}
|
3260
3260
|
onFocusEvent($event) {
|
3261
|
+
this.calculatePattern();
|
3262
|
+
}
|
3263
|
+
onInputEvent($event) {
|
3264
|
+
this.calculatePattern();
|
3265
|
+
}
|
3266
|
+
onChangeEvent($event) {
|
3267
|
+
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3268
|
+
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
3269
|
+
switch (attr) {
|
3270
|
+
case StorageAttribute.ALPHA:
|
3271
|
+
case StorageAttribute.UNICODE:
|
3272
|
+
this.formatAlphaUnicode(control);
|
3273
|
+
break;
|
3274
|
+
case StorageAttribute.BOOLEAN:
|
3275
|
+
this.formatBoolean(control);
|
3276
|
+
break;
|
3277
|
+
}
|
3278
|
+
}
|
3279
|
+
calculatePattern() {
|
3261
3280
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3262
3281
|
if (control != null) {
|
3263
3282
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
@@ -3272,28 +3291,13 @@ class MgformatMagicDirective {
|
|
3272
3291
|
}
|
3273
3292
|
else {
|
3274
3293
|
if (attr == StorageAttribute.ALPHA || attr == StorageAttribute.UNICODE) {
|
3275
|
-
|
3276
|
-
|
3277
|
-
else
|
3278
|
-
control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
|
3294
|
+
control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3295
|
+
control.updateValueAndValidity();
|
3279
3296
|
}
|
3280
3297
|
}
|
3281
3298
|
}
|
3282
3299
|
}
|
3283
3300
|
}
|
3284
|
-
onChangeEvent($event) {
|
3285
|
-
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3286
|
-
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
3287
|
-
switch (attr) {
|
3288
|
-
case StorageAttribute.ALPHA:
|
3289
|
-
case StorageAttribute.UNICODE:
|
3290
|
-
this.formatAlphaUnicode(control);
|
3291
|
-
break;
|
3292
|
-
case StorageAttribute.BOOLEAN:
|
3293
|
-
this.formatBoolean(control);
|
3294
|
-
break;
|
3295
|
-
}
|
3296
|
-
}
|
3297
3301
|
formatDate(pic) {
|
3298
3302
|
let mgDateFormatter = new MgDateFormatter();
|
3299
3303
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
@@ -3442,7 +3446,7 @@ class MgformatMagicDirective {
|
|
3442
3446
|
}
|
3443
3447
|
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
3444
3448
|
MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
3445
|
-
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
3449
|
+
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("input", function MgformatMagicDirective_input_HostBindingHandler($event) { return ctx.onInputEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
3446
3450
|
} } });
|
3447
3451
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
3448
3452
|
type: Directive,
|
@@ -3452,6 +3456,9 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
|
|
3452
3456
|
}], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
|
3453
3457
|
type: HostListener,
|
3454
3458
|
args: ['focus', ['$event']]
|
3459
|
+
}], onInputEvent: [{
|
3460
|
+
type: HostListener,
|
3461
|
+
args: ['input', ['$event']]
|
3455
3462
|
}], onChangeEvent: [{
|
3456
3463
|
type: HostListener,
|
3457
3464
|
args: ['change', ['$event']]
|