monkey-front-components 0.0.124 → 0.0.128
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 +14 -13
- package/bundles/monkey-front-components.umd.js.map +1 -1
- package/esm2015/lib/components/base/base-dynamic-array.js +4 -5
- package/esm2015/lib/components/dynamic/dynamic-directive.js +6 -7
- package/esm2015/lib/components/dynamic/form/dynamic-form-array.component.js +2 -2
- package/esm2015/lib/components/dynamic/input/input.component.js +5 -2
- package/fesm2015/monkey-front-components.js +13 -12
- package/fesm2015/monkey-front-components.js.map +1 -1
- package/lib/components/dynamic/input/input.component.d.ts +3 -2
- package/monkey-front-components-0.0.128.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-components-0.0.124.tgz +0 -0
|
@@ -735,13 +735,13 @@
|
|
|
735
735
|
return _this;
|
|
736
736
|
}
|
|
737
737
|
BaseDynamicArray.prototype.handleInternalPlusValidation = function (mainField, data) {
|
|
738
|
-
var operator = mainField.operator, value = mainField.value;
|
|
738
|
+
var operator = mainField.operator, field = mainField.field, value = mainField.value;
|
|
739
739
|
var validators = {
|
|
740
740
|
e: function (val1, val2) { return val1 === val2; },
|
|
741
741
|
lt: function (val1, val2) { return val1 < val2; },
|
|
742
742
|
gt: function (val1, val2) { return val1 > val2; }
|
|
743
743
|
};
|
|
744
|
-
return validators[operator](data, value);
|
|
744
|
+
return validators[operator](data === null || data === void 0 ? void 0 : data[field], value);
|
|
745
745
|
};
|
|
746
746
|
BaseDynamicArray.prototype.makeInternalPlusValidation = function (data, sourceField, settings, rowIndex) {
|
|
747
747
|
var _this = this;
|
|
@@ -782,7 +782,6 @@
|
|
|
782
782
|
value = '';
|
|
783
783
|
}
|
|
784
784
|
if (create) {
|
|
785
|
-
ctrl.removeControl(name);
|
|
786
785
|
var control = _this.fb.control(value, _this.bindValidations(validations || []));
|
|
787
786
|
if (disabled || _this.disabled)
|
|
788
787
|
control.disable();
|
|
@@ -804,7 +803,7 @@
|
|
|
804
803
|
var fieldType = field.fieldType, validations = field.validations, name = field.name, disabled = field.disabled, alwaysShow = field.alwaysShow;
|
|
805
804
|
var value = field.value;
|
|
806
805
|
if (field.alwaysShowPlusValidation) {
|
|
807
|
-
if (_this.handleInternalPlusValidation(field.alwaysShowPlusValidation, data))
|
|
806
|
+
if (!_this.handleInternalPlusValidation(field.alwaysShowPlusValidation, data))
|
|
808
807
|
return;
|
|
809
808
|
}
|
|
810
809
|
else if (!alwaysShow)
|
|
@@ -1069,6 +1068,9 @@
|
|
|
1069
1068
|
enumerable: false,
|
|
1070
1069
|
configurable: true
|
|
1071
1070
|
});
|
|
1071
|
+
MECXDynamicInputComponent.prototype.ngOnInit = function () {
|
|
1072
|
+
this.cdr.detectChanges();
|
|
1073
|
+
};
|
|
1072
1074
|
MECXDynamicInputComponent.prototype.ngOnChanges = function () {
|
|
1073
1075
|
this.cdr.detectChanges();
|
|
1074
1076
|
};
|
|
@@ -1091,7 +1093,7 @@
|
|
|
1091
1093
|
return MECXDynamicInputComponent;
|
|
1092
1094
|
}());
|
|
1093
1095
|
MECXDynamicInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: MECXDynamicInputComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1094
|
-
MECXDynamicInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: MECXDynamicInputComponent, selector: "mecx-dynamic-input", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-input\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [mask]=\"_field?.mask\" [prefix]=\"_field?.prefix\" [name]=\"_field?.name\"\n [formControl]=\"_form.controls[_field?.name]\" [placeholder]=\"_field?.placeholder | translate\"\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\n [type]=\"_field?.type\" #inputElement (onChange)=\"onChange($event)\"\n [onlyNumber]=\"_field?.onlyNumber\" [currency]=\"_field?.currency\" [maxLength]=\"_field?.maxLength\"\n [maxDateToday]=\"_field?.maxDateToday\">\n</monkey-input>", components: [{ type: i1__namespace$1.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "helperMessage", "placeholder", "maxLength", "maxDateToday", "value", "type", "label", "icon", "infoMessage", "errorMessage", "mask", "prefix", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent"], outputs: ["onChange"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i4__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1096
|
+
MECXDynamicInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: MECXDynamicInputComponent, selector: "mecx-dynamic-input", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-input\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [mask]=\"_field?.mask\" [prefix]=\"_field?.prefix\" [name]=\"_field?.name\"\r\n [formControl]=\"_form.controls[_field?.name]\" [placeholder]=\"_field?.placeholder | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\r\n [type]=\"_field?.type\" #inputElement (onChange)=\"onChange($event)\"\r\n [onlyNumber]=\"_field?.onlyNumber\" [currency]=\"_field?.currency\" [maxLength]=\"_field?.maxLength\"\r\n [maxDateToday]=\"_field?.maxDateToday\">\r\n</monkey-input>", components: [{ type: i1__namespace$1.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "helperMessage", "placeholder", "maxLength", "maxDateToday", "value", "type", "label", "icon", "infoMessage", "errorMessage", "mask", "prefix", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent"], outputs: ["onChange"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i4__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1095
1097
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: MECXDynamicInputComponent, decorators: [{
|
|
1096
1098
|
type: i0.Component,
|
|
1097
1099
|
args: [{
|
|
@@ -1316,7 +1318,7 @@
|
|
|
1316
1318
|
var _a, _b;
|
|
1317
1319
|
if (!((_a = this.field) === null || _a === void 0 ? void 0 : _a.alwaysShowPlusValidation))
|
|
1318
1320
|
return false;
|
|
1319
|
-
var
|
|
1321
|
+
var _e = (_b = this.field) === null || _b === void 0 ? void 0 : _b.alwaysShowPlusValidation, operator = _e.operator, value = _e.value, field = _e.field;
|
|
1320
1322
|
var validators = {
|
|
1321
1323
|
e: function (val1, val2) { return val1 === val2; },
|
|
1322
1324
|
lt: function (val1, val2) { return val1 < val2; },
|
|
@@ -1344,23 +1346,22 @@
|
|
|
1344
1346
|
};
|
|
1345
1347
|
MECXDynamicDirective.prototype.ngOnChanges = function () {
|
|
1346
1348
|
var _this = this;
|
|
1347
|
-
var _a, _b;
|
|
1349
|
+
var _a, _b, _c, _d;
|
|
1348
1350
|
if (this.plusValidations && this.plusValidations[this.field.name]) {
|
|
1349
1351
|
if (!this.field.alwaysShow && this.plusValidations[this.field.name].alwaysShow) {
|
|
1350
1352
|
setTimeout(function () {
|
|
1351
1353
|
_this.buildComponent();
|
|
1352
1354
|
_this.cdr.detectChanges();
|
|
1353
1355
|
}, 1);
|
|
1354
|
-
return;
|
|
1355
1356
|
}
|
|
1356
|
-
if ((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance) {
|
|
1357
|
+
if (((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance) && !this.plusValidations[this.field.name].alwaysShow) {
|
|
1357
1358
|
this.componentRef.destroy();
|
|
1358
1359
|
this.componentRef = null;
|
|
1359
|
-
this.form.controls[this.field.name].setValue(null);
|
|
1360
|
-
this.form.controls[this.field.name].clearValidators();
|
|
1360
|
+
(_b = this.form.controls[this.field.name]) === null || _b === void 0 ? void 0 : _b.setValue(null);
|
|
1361
|
+
(_c = this.form.controls[this.field.name]) === null || _c === void 0 ? void 0 : _c.clearValidators();
|
|
1361
1362
|
}
|
|
1362
1363
|
}
|
|
1363
|
-
if (!((
|
|
1364
|
+
if (!((_d = this.componentRef) === null || _d === void 0 ? void 0 : _d.instance))
|
|
1364
1365
|
return;
|
|
1365
1366
|
this.componentRef.instance._formErrors = this.formErrors || {};
|
|
1366
1367
|
};
|
|
@@ -1492,7 +1493,7 @@
|
|
|
1492
1493
|
return MECXDynamicFormArrayComponent;
|
|
1493
1494
|
}(BaseDynamicArray));
|
|
1494
1495
|
MECXDynamicFormArrayComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, deps: [{ token: i1__namespace.FormBuilder }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1495
|
-
MECXDynamicFormArrayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", 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=\"indForm > 0\">\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]=\"__monkeyexcFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\">\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()\">\n</monkey-button>", styles: ["mecx-dynamic-form-array monkey-button{width:100%}mecx-dynamic-form-array monkey-button button{width:100%;height:40px}"], components: [{ type: i1__namespace$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["iconPosition", "disabled", "label", "icon", "type", "color"] }], directives: [{ type: i3__namespace.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.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": i4__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1496
|
+
MECXDynamicFormArrayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", 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=\"indForm > 0 && !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]=\"__monkeyexcFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\">\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}"], components: [{ type: i1__namespace$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["iconPosition", "disabled", "label", "icon", "type", "color"] }], directives: [{ type: i3__namespace.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.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": i4__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
1496
1497
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, decorators: [{
|
|
1497
1498
|
type: i0.Component,
|
|
1498
1499
|
args: [{
|