Skip to content

Commit

Permalink
accounted for caption padding and changed error messaging on Required…
Browse files Browse the repository at this point in the history
… validator
  • Loading branch information
ezra0619 committed Dec 5, 2023
1 parent 9e53044 commit 34d0514
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion projects/demo/src/app/demo/demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class DemoComponent {
return Promise.resolve({async: 'something'});
}
],
emails: [''],
emails: ['', Validators.required],
disabledButRendered: ['disabledButRendered'],
unrendered: ['unrendered'],
yesno: false,
Expand Down
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "14.10.0",
"version": "14.10.1",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ $triangleSize: 12px;
.errorContainer {
color: $default-warning;
&.hasCaption {
margin-left: 40%;
margin-left: calc(40% + $spacing-medium);
&.d30-70 {
margin-left: 30%;
margin-left: calc(30% + $spacing-medium);
}
&.d34-66 {
margin-left: 34%;
margin-left: calc(34% + $spacing-medium);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import {Component, Directive, ElementRef, Host, Inject, InjectionToken, Input, OnInit, Optional, ViewChild} from '@angular/core';
import {AbstractControl, FormArray, UntypedFormControl, FormGroup} from '@angular/forms';
import {FormComponent} from '../form.component';
import {Component, ElementRef, Inject, InjectionToken, Input, Optional, ViewChild} from '@angular/core';
import {AbstractControl, UntypedFormControl} from '@angular/forms';
import {ValueAccessorBase} from '../../elements/value-accessor-base/value-accessor-base.component';
import {CustomErrorMessages, FormErrorMessages} from '../../types';
import { ValueAccessorBase } from '../../elements/value-accessor-base/value-accessor-base.component';
import { isValueSet } from '../../util/values';
import {isValueSet} from '../../util/values';
import {FormComponent} from '../form.component';


export const FORM_ERROR_MESSAGES = new InjectionToken<CustomErrorMessages>('form.error.messages');

export const DEFAULT_ERROR_MESSAGES: FormErrorMessages = {
min: 'Use a number larger than %min%',
max: 'Use a number smaller than %max%',
required: 'This field is required',
required: 'Required',
email: 'Use a valid email address',
minLength: 'Has to be longer than %minLength% character(s)',
maxLength: 'Has to be shorter than %maxLength% character(s)',
Expand Down

0 comments on commit 34d0514

Please sign in to comment.