Skip to content
Snippets Groups Projects
Commit 8aa6e5a9 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5789 Use material required props

parent 4d53c0b9
Branches
Tags
No related merge requests found
Showing
with 13 additions and 24 deletions
......@@ -41,6 +41,7 @@ type TextInputVariants = VariantProps<typeof textInputVariants>;
[ngClass]="textInputVariants({ variant })"
[placeholder]="placeholder"
[autocomplete]="autocomplete"
[attr.aria-required]="required"
/>
</div>
<ng-content select="[error]"></ng-content>
......
......@@ -39,6 +39,7 @@ type TextareaVariants = VariantProps<typeof textareaVariants>;
[ngClass]="textareaVariants({ variant })"
[placeholder]="placeholder"
[autocomplete]="autocomplete"
[attr.aria-required]="required"
></textarea>
<ng-content select="[error]"></ng-content>
</div>
......
......@@ -29,6 +29,7 @@
[formControlName]="formServiceClass.FIELD_EMAIL"
autocomplete="email"
placeholder="E-Mail Adresse"
[required]="true"
>
</ozgcloud-text-editor>
......@@ -36,6 +37,7 @@
label="Passwort"
[formControlName]="formServiceClass.FIELD_PASSWORD"
placeholder="Passwort für die Verschlüsselung"
[required]="true"
>
</ozgcloud-text-editor>
......
......@@ -29,6 +29,7 @@
<input
#autocompleteInput
[attr.data-test-id]="(label | convertForDataTest) + '-autocomplete-input'"
[required]="required"
type="text"
matInput
[matAutocomplete]="auto"
......
......@@ -45,6 +45,7 @@ export class AutocompleteEditorComponent
{
@Input() label: string;
@Input() values: Selectable[] = [];
@Input() required: boolean = false;
@Output() onKeyUp: EventEmitter<void> = new EventEmitter();
@Output() onOptionSelected: EventEmitter<Selectable> = new EventEmitter();
......
......@@ -24,19 +24,13 @@
-->
<mat-form-field>
<mat-label
>{{ label
}}<ng-container *ngIf="required">
<i aria-hidden="true">*</i>
<i class="sr-only">(erforderlich)</i>
</ng-container>
</mat-label>
<mat-label>{{ label }}</mat-label>
<input
matInput
[matDatepicker]="picker"
[formControl]="fieldControl"
(blur)="touch()"
[attr.aria-required]="required"
[required]="required"
[attr.data-test-id]="(label | convertForDataTest) + '-date-input'"
(dateInput)="inputEvent($event)"
(blur)="onBlur()"
......
......@@ -29,13 +29,7 @@
appearance="{{ appearance }}"
[floatLabel]="readOnly || autoFocus ? 'always' : 'auto'"
>
<mat-label
>{{ label
}}<ng-container *ngIf="required">
<i aria-hidden="true">*</i>
<i class="sr-only">(erforderlich)</i>
</ng-container>
</mat-label>
<mat-label>{{ label }}</mat-label>
<div class="wrapper">
<input
#inputElement
......@@ -45,7 +39,7 @@
[autocomplete]="autocomplete"
[readonly]="readOnly"
(blur)="touch()"
[attr.aria-required]="required"
[required]="required"
[attr.data-test-id]="(label | convertForDataTest) + '-text-input'"
[class.with-clear-button]="showClearButton$ | async"
/>
......
......@@ -24,13 +24,7 @@
-->
<mat-form-field [appearance]="appearance" [floatLabel]="autoFocus ? 'always' : 'auto'">
<mat-label
>{{ label
}}<ng-container *ngIf="required">
<i aria-hidden="true">*</i>
<i class="sr-only">(erforderlich)</i>
</ng-container>
</mat-label>
<mat-label>{{ label }}</mat-label>
<textarea
#autosize="cdkTextareaAutosize"
......@@ -38,7 +32,7 @@
matInput
cdkTextareaAutosize
[formControl]="fieldControl"
[attr.aria-required]="required"
[required]="required"
[attr.data-test-id]="(label | convertForDataTest) + '-textarea-input'"
(blur)="touch()"
></textarea>
......
......@@ -27,6 +27,7 @@
<ozgcloud-autocomplete-editor
data-test-id="user-search"
label="Bearbeiter"
[required]="true"
[formControlName]="formServiceClass.SEARCH_FIELD"
[values]="searchedUserProfiles.resource"
(onKeyUp)="onKeyUp()"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment