2019-01-29 17:34:19 +01:00
|
|
|
<div *ngIf="form && this.visibilityRulesService.checkElementVisibility(this.form.get('id').value)" [id]="this.form.get('id').value"
|
|
|
|
[formGroup]="form" [ngSwitch]="this.form.get('viewStyle').value.renderStyle" class="dynamic-form-field row">
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2019-02-01 09:29:00 +01:00
|
|
|
<h5 *ngIf="this.form.get('title').value && !isChild">{{this.form.get('title').value}}</h5>
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2019-02-01 09:29:00 +01:00
|
|
|
<h5 *ngIf="this.form.get('description').value && !isChild" class="col-12">{{this.form.get('description').value}}</h5>
|
|
|
|
<h5 *ngIf="this.form.get('extendedDescription').value && !isChild" class="col-12"><i>{{this.form.get('extendedDescription').value}}</i></h5>
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.FreeText" class="col-12">
|
2019-02-08 10:04:12 +01:00
|
|
|
<input matInput [formControl]="form.get('value')" placeholder="{{form.get('data').value.label}}" [required]="form.get('validationRequired').value">
|
2019-01-18 18:03:45 +01:00
|
|
|
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED'
|
|
|
|
| translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.ComboBox" class="col-12">
|
|
|
|
<div class="row">
|
2019-01-28 14:47:31 +01:00
|
|
|
<mat-form-field class="col-md-12" *ngIf="form.get('data').value.type === datasetProfileComboBoxTypeEnum.Autocomplete">
|
2019-02-08 10:04:12 +01:00
|
|
|
<app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
|
2019-01-29 17:34:19 +01:00
|
|
|
[configuration]="singleAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
|
2019-01-21 12:14:20 +01:00
|
|
|
</app-single-auto-complete>
|
|
|
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2019-01-28 14:47:31 +01:00
|
|
|
<mat-form-field *ngIf="form.get('data').value.type === datasetProfileComboBoxTypeEnum.WordList" class="col-md-12">
|
2019-01-29 17:34:19 +01:00
|
|
|
<mat-select [formControl]="form.get('value')" placeholder="{{ form.get('data').value.label | translate }}"
|
|
|
|
[required]="form.get('validationRequired').value">
|
2019-02-04 17:10:22 +01:00
|
|
|
<mat-option *ngFor="let opt of form.get('data').value.options" [value]="opt.value">{{opt.label}}</mat-option>
|
2019-01-21 12:14:20 +01:00
|
|
|
</mat-select>
|
|
|
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.CheckBox" class="col-12">
|
2019-01-28 14:47:31 +01:00
|
|
|
<mat-checkbox [formControl]="form.get('value')" [required]="form.get('validationRequired').value">{{form.get('data').value.label}}</mat-checkbox>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.TextArea" class="col-12">
|
2019-02-08 10:04:12 +01:00
|
|
|
<textarea matInput [formControl]="form.get('value')" matTextareaAutosize matAutosizeMinRows="2" matAutosizeMaxRows="10"
|
|
|
|
[required]="form.get('validationRequired').value" placeholder="{{ form.get('data').value.label | translate }}"></textarea>
|
2019-01-29 17:34:19 +01:00
|
|
|
<button mat-icon-button *ngIf="!form.get('value').disabled && form.get('value').value" matSuffix aria-label="Clear"
|
|
|
|
(click)="this.form.patchValue({'value': ''})">
|
2019-01-18 18:03:45 +01:00
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
</button>
|
2019-01-29 17:34:19 +01:00
|
|
|
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED'
|
|
|
|
| translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.BooleanDecision" class="col-12">
|
2019-01-28 14:47:31 +01:00
|
|
|
<mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value">
|
|
|
|
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="true">Yes</mat-radio-button>
|
|
|
|
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="false">No</mat-radio-button>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-radio-group>
|
2019-02-08 11:31:22 +01:00
|
|
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
|
|
|
|
2019-01-21 12:14:20 +01:00
|
|
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.RadioBox" class="col-12">
|
2019-01-28 14:47:31 +01:00
|
|
|
<mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value">
|
2019-01-29 17:34:19 +01:00
|
|
|
<mat-radio-button *ngFor="let option of form.get('data').value.options let index = index" class="radio-button-item"
|
|
|
|
[value]="option.value">{{option.label}}</mat-radio-button>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-radio-group>
|
2019-02-08 11:31:22 +01:00
|
|
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
2019-01-29 17:34:19 +01:00
|
|
|
</div>
|