no message
This commit is contained in:
parent
556b1706d6
commit
e4276815a9
|
@ -1,5 +1,5 @@
|
||||||
<div [formGroup]="form">
|
<div [formGroup]="form">
|
||||||
<mat-radio-group formControlName="value">
|
<mat-radio-group formControlName="value" [required]="field.validationRequired">
|
||||||
<mat-radio-button name="{{field.id}}" value="true">Yes</mat-radio-button>
|
<mat-radio-button name="{{field.id}}" value="true">Yes</mat-radio-button>
|
||||||
<br>
|
<br>
|
||||||
<mat-radio-button name="{{field.id}}" value="false">No</mat-radio-button>
|
<mat-radio-button name="{{field.id}}" value="false">No</mat-radio-button>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div [formGroup]="form" class="form-group">
|
<div [formGroup]="form" class="form-group">
|
||||||
<mat-checkbox formControlName="value">{{field.data.label}}</mat-checkbox>
|
<mat-checkbox formControlName="value" [required]="field.validationRequired">{{field.data.label}}</mat-checkbox>
|
||||||
<!-- <input type="checkbox" formControlName="value"> -->
|
<!-- <input type="checkbox" formControlName="value"> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div [formGroup]="form">
|
<div [formGroup]="form">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select formControlName="value">
|
<mat-select formControlName="value" [required]="field.validationRequired">
|
||||||
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}</mat-option>
|
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div [formGroup]="form">
|
<div [formGroup]="form">
|
||||||
<mat-radio-group formControlName="value">
|
<mat-radio-group formControlName="value" [required]="field.validationRequired">
|
||||||
<div *ngFor="let option of this.field.data.options let index = index">
|
<div *ngFor="let option of this.field.data.options let index = index">
|
||||||
<mat-radio-button [value]="option.value" >{{option.label}}</mat-radio-button>
|
<mat-radio-button [value]="option.value" >{{option.label}}</mat-radio-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<div *ngSwitchCase="'freetext'">
|
<div *ngSwitchCase="'freetext'">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput formControlName="value" placeholder="{{field.data.label}}">
|
<input matInput formControlName="value" placeholder="{{field.data.label}}" [required]="field.validationRequired">
|
||||||
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<div *ngSwitchCase="'textarea'">
|
<div *ngSwitchCase="'textarea'">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<textarea matInput formControlName="value" matTextareaAutosize matAutosizeMinRows="2" matAutosizeMaxRows="10"> </textarea>
|
<textarea matInput formControlName="value" matTextareaAutosize matAutosizeMinRows="2" matAutosizeMaxRows="10" [required]="field.validationRequired"> </textarea>
|
||||||
<button mat-button *ngIf="form.get('value').value" matSuffix mat-icon-button aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
<button mat-button *ngIf="form.get('value').value" matSuffix mat-icon-button aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -67,19 +67,26 @@ export class AutocompleteComponent implements OnInit {
|
||||||
|
|
||||||
const valueChanges = this.control.valueChanges.share();
|
const valueChanges = this.control.valueChanges.share();
|
||||||
valueChanges.subscribe(searchTerm => {
|
valueChanges.subscribe(searchTerm => {
|
||||||
this.loading = true;
|
|
||||||
if (this.hasSelectedItem) {
|
if (this.hasSelectedItem) {
|
||||||
this.resetFormControlValue();
|
this.resetFormControlValue();
|
||||||
|
}else{
|
||||||
|
this.loading = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
valueChanges
|
valueChanges
|
||||||
.debounceTime(this.delay)
|
.debounceTime(this.delay)
|
||||||
.finally(() => this.loading = false)
|
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.switchMap(val => {
|
.switchMap(val => {
|
||||||
//if (this.hasSelectedItem) return [];
|
if (this.hasSelectedItem) {
|
||||||
|
this.loading = false;
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
this.configuration.requestItem.criteria.like = this.control.value;
|
this.configuration.requestItem.criteria.like = this.control.value;
|
||||||
return this.configuration.callback(this.configuration.requestItem).map(result=>this.filteredItems = (<any[]>result))
|
return this.configuration.callback(this.configuration.requestItem).map(result => {
|
||||||
|
this.filteredItems = (<any[]>result)
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
}).subscribe()
|
}).subscribe()
|
||||||
|
|
||||||
// this.filteredItems = this.inputField.nativeElement.valueChanges.startWith(null)
|
// this.filteredItems = this.inputField.nativeElement.valueChanges.startWith(null)
|
||||||
|
|
Loading…
Reference in New Issue