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

Merge pull request 'OZG-5789 Use material required props' (#626) from...

Merge pull request 'OZG-5789 Use material required props' (#626) from OZG-5789-fix-required into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/626


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 5991d1c5 8bcce03e
No related branches found
No related tags found
No related merge requests found
Showing
with 15 additions and 32 deletions
......@@ -28,10 +28,7 @@ type TextInputVariants = VariantProps<typeof textInputVariants>;
template: `
<div>
<label [for]="id" class="text-md mb-2 block font-medium text-text"
>{{ label
}}<ng-container *ngIf="required"
><i aria-hidden="true">*</i><i class="sr-only">(erforderlich)</i></ng-container
></label
>{{ label }}<ng-container *ngIf="required"><i aria-hidden="true">*</i></ng-container></label
>
<div class="mt-2">
<input
......@@ -41,6 +38,7 @@ type TextInputVariants = VariantProps<typeof textInputVariants>;
[ngClass]="textInputVariants({ variant })"
[placeholder]="placeholder"
[autocomplete]="autocomplete"
[required]="required"
/>
</div>
<ng-content select="[error]"></ng-content>
......
......@@ -27,10 +27,7 @@ type TextareaVariants = VariantProps<typeof textareaVariants>;
template: `
<div class="mt-2">
<label [for]="id" class="text-md mb-2 block font-medium text-text"
>{{ label
}}<ng-container *ngIf="required"
><i aria-hidden="true">*</i><i class="sr-only">(erforderlich)</i></ng-container
></label
>{{ label }}<ng-container *ngIf="required"><i aria-hidden="true">*</i></ng-container></label
>
<textarea
[id]="id"
......@@ -39,6 +36,7 @@ type TextareaVariants = VariantProps<typeof textareaVariants>;
[ngClass]="textareaVariants({ variant })"
[placeholder]="placeholder"
[autocomplete]="autocomplete"
[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