ngx-render-material-forms 1.3.3 → 1.3.5
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/lib/components/datagrid/datagrid.component.mjs +4 -2
- package/esm2020/lib/components/textarea/textarea.component.mjs +9 -3
- package/esm2020/lib/components/textfield/textfield.component.mjs +4 -1
- package/fesm2015/ngx-render-material-forms.js +14 -3
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +14 -3
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -1
- package/lib/components/textarea/textarea.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -513,6 +513,9 @@ class MaterialTextfieldComponent extends MaterialComponent {
|
|
|
513
513
|
this.controlHasError = this.control.hasError(msg.context.validator);
|
|
514
514
|
}
|
|
515
515
|
if (msg.context && this.controlHasError) {
|
|
516
|
+
if (this.instance.parent.submission.data.submit) {
|
|
517
|
+
this.control.markAllAsTouched();
|
|
518
|
+
}
|
|
516
519
|
return this.instance.error.message;
|
|
517
520
|
}
|
|
518
521
|
}
|
|
@@ -1056,6 +1059,12 @@ class MaterialTextareaComponent extends MaterialComponent {
|
|
|
1056
1059
|
// Attach the element so the wysiwyg will work.
|
|
1057
1060
|
this.instance.attachElement(this.textarea.nativeElement);
|
|
1058
1061
|
}
|
|
1062
|
+
getErrorMessage() {
|
|
1063
|
+
if (this.instance.parent.submission.data.submit) {
|
|
1064
|
+
this.control.markAllAsTouched();
|
|
1065
|
+
}
|
|
1066
|
+
return this.instance.error.message;
|
|
1067
|
+
}
|
|
1059
1068
|
getValue() {
|
|
1060
1069
|
return isNil(this.control.value) ? '' : this.control.value;
|
|
1061
1070
|
}
|
|
@@ -1082,7 +1091,7 @@ MaterialTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
|
|
|
1082
1091
|
>
|
|
1083
1092
|
</textarea>
|
|
1084
1093
|
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
1085
|
-
<mat-error *ngIf="instance.error">{{
|
|
1094
|
+
<mat-error *ngIf="instance.error">{{ getErrorMessage() }}</mat-error>
|
|
1086
1095
|
</mat-form-field>
|
|
1087
1096
|
</ng-template>
|
|
1088
1097
|
`, isInline: true, styles: [".mat-input-element{min-height:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i5.DefaultFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i6.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
@@ -1109,7 +1118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
1109
1118
|
>
|
|
1110
1119
|
</textarea>
|
|
1111
1120
|
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
1112
|
-
<mat-error *ngIf="instance.error">{{
|
|
1121
|
+
<mat-error *ngIf="instance.error">{{ getErrorMessage() }}</mat-error>
|
|
1113
1122
|
</mat-form-field>
|
|
1114
1123
|
</ng-template>
|
|
1115
1124
|
`, styles: [".mat-input-element{min-height:16px}\n"] }]
|
|
@@ -2999,7 +3008,9 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
|
|
|
2999
3008
|
}
|
|
3000
3009
|
removeRow(index) {
|
|
3001
3010
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
|
3002
|
-
disableClose: true
|
|
3011
|
+
disableClose: true,
|
|
3012
|
+
width: '90%',
|
|
3013
|
+
maxWidth: '400px'
|
|
3003
3014
|
});
|
|
3004
3015
|
dialogRef.afterClosed().subscribe(result => {
|
|
3005
3016
|
if (result) {
|