monkey-front-components 0.0.175 → 0.0.176
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/bundles/monkey-front-components.umd.js +12 -12
- package/bundles/monkey-front-components.umd.js.map +1 -1
- package/esm2015/lib/components/base/base-component.js +7 -7
- package/esm2015/lib/components/dynamic/form/dynamic-form-array.component.js +5 -5
- package/esm2015/lib/components/dynamic/form/dynamic-form.component.js +3 -3
- package/fesm2015/monkey-front-components.js +12 -12
- package/fesm2015/monkey-front-components.js.map +1 -1
- package/lib/components/base/base-component.d.ts +1 -1
- package/monkey-front-components-0.0.176.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-components-0.0.175.tgz +0 -0
|
@@ -472,10 +472,10 @@
|
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
474
|
if (i1.MonkeyUtils.persistNullEmptyUndefined(index)) {
|
|
475
|
-
this.
|
|
475
|
+
this.__monkeyecxFormErrors[index] = formErrors;
|
|
476
476
|
}
|
|
477
477
|
else {
|
|
478
|
-
this.
|
|
478
|
+
this.__monkeyecxFormErrors = formErrors;
|
|
479
479
|
}
|
|
480
480
|
return false;
|
|
481
481
|
};
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
}
|
|
514
514
|
});
|
|
515
515
|
if (i1.MonkeyUtils.persistNullEmptyUndefined(index)) {
|
|
516
|
-
this.
|
|
516
|
+
this.__monkeyecxFormErrors[index] = formErrors;
|
|
517
517
|
}
|
|
518
518
|
else {
|
|
519
519
|
var obj = void 0;
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
else {
|
|
526
526
|
obj = formErrors;
|
|
527
527
|
}
|
|
528
|
-
this.
|
|
528
|
+
this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), obj);
|
|
529
529
|
}
|
|
530
530
|
f.markAllAsTouched();
|
|
531
531
|
return false;
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
};
|
|
560
560
|
BaseComponent.prototype.handleErrorFromServices = function (error, f) {
|
|
561
561
|
var _this = this;
|
|
562
|
-
this.
|
|
562
|
+
this.__monkeyecxFormErrors = null;
|
|
563
563
|
if (error.type === 'Parameter_Error') {
|
|
564
564
|
Object.entries(f.value).forEach(function (_a) {
|
|
565
565
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
firstMessage: '',
|
|
573
573
|
lastMessage: description
|
|
574
574
|
};
|
|
575
|
-
_this.
|
|
575
|
+
_this.__monkeyecxFormErrors = Object.assign(Object.assign({}, _this.__monkeyecxFormErrors), (_a = {}, _a[key] = msg, _a));
|
|
576
576
|
f.controls[key].setErrors({
|
|
577
577
|
incorrect: true
|
|
578
578
|
});
|
|
@@ -1494,7 +1494,7 @@
|
|
|
1494
1494
|
MECXDynamicFormComponent.prototype.onSubmit = function (callback) {
|
|
1495
1495
|
var _form = this._form;
|
|
1496
1496
|
// eslint-disable-next-line object-curly-newline
|
|
1497
|
-
this.
|
|
1497
|
+
this.__monkeyecxFormErrors = {};
|
|
1498
1498
|
var isValid = this.validateForm(_form);
|
|
1499
1499
|
this.cdr.detectChanges();
|
|
1500
1500
|
this.onHandleSubmitFormReady.next({
|
|
@@ -1508,7 +1508,7 @@
|
|
|
1508
1508
|
return MECXDynamicFormComponent;
|
|
1509
1509
|
}(BaseDynamic));
|
|
1510
1510
|
MECXDynamicFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormComponent, deps: [{ token: i1__namespace.FormBuilder }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1511
|
-
MECXDynamicFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormComponent, selector: "mecx-dynamic-form", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div class=\"row\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"_form\" [self]=\"self\"\n [formErrors]=\"
|
|
1511
|
+
MECXDynamicFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormComponent, selector: "mecx-dynamic-form", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div class=\"row\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"_form\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors\" [style.display]=\"'none'\">\n </div>\n </div>\n</form>", directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1512
1512
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormComponent, decorators: [{
|
|
1513
1513
|
type: i0.Component,
|
|
1514
1514
|
args: [{
|
|
@@ -1525,7 +1525,7 @@
|
|
|
1525
1525
|
var _this = _super.call(this, fb) || this;
|
|
1526
1526
|
_this.cdr = cdr;
|
|
1527
1527
|
_this.unsubscribeAll = new rxjs.Subject();
|
|
1528
|
-
_this.
|
|
1528
|
+
_this.__monkeyecxFormErrors = [];
|
|
1529
1529
|
return _this;
|
|
1530
1530
|
}
|
|
1531
1531
|
MECXDynamicFormArrayComponent.prototype.ngOnInit = function () {
|
|
@@ -1543,13 +1543,13 @@
|
|
|
1543
1543
|
var _this = this;
|
|
1544
1544
|
var _form = this._form;
|
|
1545
1545
|
// eslint-disable-next-line object-curly-newline
|
|
1546
|
-
this.
|
|
1546
|
+
this.__monkeyecxFormErrors = [];
|
|
1547
1547
|
var validate = {
|
|
1548
1548
|
isValid: false
|
|
1549
1549
|
};
|
|
1550
1550
|
var hasErrors = false;
|
|
1551
1551
|
if (this.formValues) {
|
|
1552
|
-
this.
|
|
1552
|
+
this.__monkeyecxFormErrors = [this.formValues.length];
|
|
1553
1553
|
this.formValues.controls.forEach(function (item, index) {
|
|
1554
1554
|
if (item instanceof i1$1.FormGroup) {
|
|
1555
1555
|
if (!_this.validateForm(item, index)) {
|
|
@@ -1579,7 +1579,7 @@
|
|
|
1579
1579
|
return MECXDynamicFormArrayComponent;
|
|
1580
1580
|
}(BaseDynamicArray));
|
|
1581
1581
|
MECXDynamicFormArrayComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, deps: [{ token: i1__namespace.FormBuilder }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1582
|
-
MECXDynamicFormArrayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormArrayComponent, selector: "mecx-dynamic-form-array", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div formArrayName=\"fields\">\n <div *ngFor=\"let item of formValues.controls; let indForm=index\" [formGroupName]=\"indForm\">\n <monkey-button type=\"secondary\" color=\"error\" icon=\"close-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.REMOVE' | translate\" (click)=\"onHandleRemove(indForm)\"\n *ngIf=\"formValues.controls.length > 1 && !disabled\">\n </monkey-button>\n <div class=\"row mt-3\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"item\" [self]=\"self\"\n [formErrors]=\"
|
|
1582
|
+
MECXDynamicFormArrayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormArrayComponent, selector: "mecx-dynamic-form-array", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div formArrayName=\"fields\">\n <div *ngFor=\"let item of formValues.controls; let indForm=index\" [formGroupName]=\"indForm\">\n <monkey-button type=\"secondary\" color=\"error\" icon=\"close-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.REMOVE' | translate\" (click)=\"onHandleRemove(indForm)\"\n *ngIf=\"formValues.controls.length > 1 && !disabled\">\n </monkey-button>\n <div class=\"row mt-3\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"item\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\" [style.display]=\"'none'\">\n </div>\n </div>\n </div>\n </div>\n</form>\n<monkey-button type=\"secondary\" color=\"theme\" icon=\"more-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.ADD' | translate\" (click)=\"onHandleAdd()\" *ngIf=\"!disabled\">\n</monkey-button>", styles: ["mecx-dynamic-form-array monkey-button{width:100%}mecx-dynamic-form-array monkey-button button{width:100%;height:40px}\n"], components: [{ type: i1__namespace$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1583
1583
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, decorators: [{
|
|
1584
1584
|
type: i0.Component,
|
|
1585
1585
|
args: [{
|