mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Add FullWidth Support to Text Input Component
This commit is contained in:
@@ -25,6 +25,7 @@ export class UiTextInputComponent implements ControlValueAccessor {
|
||||
@Input() label = '';
|
||||
@Input() suffix: string;
|
||||
@Input() placeholder = '';
|
||||
@Input() fullWidth = true;
|
||||
|
||||
constructor(private cdr: ChangeDetectorRef) {}
|
||||
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
<div class="isa-form-field">
|
||||
<label>
|
||||
<label [class.expand]="fullWidth">
|
||||
{{ label }}
|
||||
<input resize type="text" [(ngModel)]="value" (input)="handleInput()" (blur)="handleBlur()"
|
||||
(focus)="handleFocus(true)" [disabled]="!editable" [placeholder]="placeholder" />
|
||||
<input
|
||||
resize
|
||||
type="text"
|
||||
[(ngModel)]="value"
|
||||
(input)="handleInput()"
|
||||
(blur)="handleBlur()"
|
||||
(focus)="handleFocus(true)"
|
||||
[disabled]="!editable"
|
||||
[placeholder]="placeholder"
|
||||
/>
|
||||
<span class="isa-font-weight-bold suffix">{{ suffix }}</span>
|
||||
</label>
|
||||
|
||||
<button *ngIf="editable && value?.length && touched && focussed" class="isa-input-reset-sm"
|
||||
(click)="reset()"></button>
|
||||
<button
|
||||
*ngIf="editable && value?.length && touched && focussed"
|
||||
class="isa-input-reset-sm"
|
||||
(click)="reset()"
|
||||
></button>
|
||||
|
||||
<span *ngIf="!editable" class="status">Nicht Änderbar</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
$status-width: 115px;
|
||||
|
||||
input {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
label {
|
||||
&.expand {
|
||||
display: flex;
|
||||
width: calc(95% - #{$status-width});
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
width: $status-width;
|
||||
}
|
||||
|
||||
.suffix {
|
||||
margin-left: -30px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user