2019-01-18 18:03:45 +01:00
< div * ngIf = "form && field" [ id ] = " field . id " [ formGroup ] = " form " [ ngSwitch ] = " field . viewStyle . renderStyle " class = "dynamic-form-field row" >
<!-- <h5 *ngIf="field.title">{{field.title}}</h5> -->
< h5 * ngIf = "field.description" class = "col-12" > {{field.description}}< / h5 >
< h5 * ngIf = "field.extendedDescription" class = "col-12" > < i > {{field.extendedDescription}}< / i > < / h5 >
2019-01-21 12:14:20 +01:00
< mat-form-field * ngSwitchCase = "datasetProfileFieldViewStyleEnum.FreeText" class = "col-12" >
2019-01-18 18:03:45 +01:00
< input matInput formControlName = "value" placeholder = "{{field.data.label}}" [ required ] = " field . validationRequired " >
< 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-25 14:54:14 +01:00
< mat-form-field class = "col-md-12" * ngIf = "this.field.data.type === datasetProfileComboBoxTypeEnum.Autocomplete" >
< app-single-auto-complete placeholder = "{{ form.get('data').value.label | translate }}" [ formControl ] = " form . get ( ' value ' ) " [ configuration ] = " singleAutoCompleteConfiguration " >
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 >
< mat-form-field * ngIf = "this.field.data.type === datasetProfileComboBoxTypeEnum.WordList" class = "col-md-12" >
< mat-select [ formControl ] = " form . get ( ' value ' ) " [ required ] = " field . validationRequired " >
< mat-option * ngFor = "let opt of field.data.options" [ value ] = " assignDropdownItem ( opt ) " > {{opt.label}}< / mat-option >
< / 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-18 18:03:45 +01:00
< mat-checkbox [ formControl ] = " form . get ( ' value ' ) " [ required ] = " field . validationRequired " > {{field.data.label}}< / mat-checkbox >
< / div >
2019-01-21 12:14:20 +01:00
< mat-form-field * ngSwitchCase = "datasetProfileFieldViewStyleEnum.TextArea" class = "col-12" >
2019-01-18 18:03:45 +01:00
< textarea matInput formControlName = "value" matTextareaAutosize matAutosizeMinRows = "2" matAutosizeMaxRows = "10" [ required ] = " field . validationRequired " > < / textarea >
< button mat-icon-button * ngIf = "!form.get('value').disabled && form.get('value').value" matSuffix aria-label = "Clear" ( click ) = " this . form . patchValue ( { ' value ' : ' ' } ) " >
< mat-icon > close< / mat-icon >
< / button >
< 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.BooleanDecision" class = "col-12" >
2019-01-18 18:03:45 +01:00
< mat-radio-group [ formControl ] = " form . get ( ' value ' ) " [ required ] = " field . validationRequired " >
< mat-radio-button class = "radio-button-item" name = "{{field.id}}" value = "true" > Yes< / mat-radio-button >
<!-- <br> -->
< mat-radio-button class = "radio-button-item" name = "{{field.id}}" value = "false" > No< / mat-radio-button >
< / mat-radio-group >
< / div >
2019-01-21 12:14:20 +01:00
< div * ngSwitchCase = "datasetProfileFieldViewStyleEnum.RadioBox" class = "col-12" >
2019-01-18 18:03:45 +01:00
< mat-radio-group [ formControl ] = " form . get ( ' value ' ) " [ required ] = " field . validationRequired " >
< mat-radio-button * ngFor = "let option of field.data.options let index = index" class = "radio-button-item" [ value ] = " option . value " > {{option.label}}< / mat-radio-button >
< / mat-radio-group >
< / div >
< / div >