validation field
This commit is contained in:
parent
71aebdae7d
commit
3c4901b395
|
@ -0,0 +1,3 @@
|
|||
export enum ValidationTypes {
|
||||
required
|
||||
}
|
|
@ -15,11 +15,11 @@
|
|||
<input data-toggle="tooltip" title="tooltip on second input!" type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label>description</label>
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" formControlName="description">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label>extendedDescription</label>
|
||||
<label>ExtendedDescription</label>
|
||||
<input type="text" class="form-control" formControlName="extendedDescription">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -32,18 +32,6 @@
|
|||
<div *ngSwitchCase="'radiobox'">
|
||||
<radiobox-component [form]="form" [dataModel]="dataModel"></radiobox-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'freetext'">
|
||||
<freetext-component [form]="form" [dataModel]="dataModel"></freetext-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'textarea'">
|
||||
<textarea-component [form]="form" [dataModel]="dataModel"></textarea-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'booleanDecision'">
|
||||
<booleanDecision-component [form]="form" [dataModel]="dataModel"></booleanDecision-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'checkbox'">
|
||||
<checkbox-component [form]="form" [dataModel]="dataModel"></checkbox-component>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
|
@ -75,11 +63,17 @@
|
|||
<input type="number" class="form-control" formControlName="ordinal">
|
||||
</div>
|
||||
<div formGroupName="defaultValue">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-5">
|
||||
<label>Default Value</label>
|
||||
<input type="text" class="form-control" formControlName="value">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<label>Validation</label>
|
||||
<select class="form-control" formControlName="validation">
|
||||
<option value="required">Required Field</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label *ngIf="showMultiplicity">
|
||||
|
|
|
@ -12,6 +12,7 @@ import {Multiplicity} from './Multiplicity';
|
|||
import {DefaultValue} from './DefaultValue';
|
||||
import {ViewStyle} from './ViewStyle';
|
||||
import {Visibility} from './Visibility';
|
||||
import { ValidationTypes } from 'app/common/validationTypes';
|
||||
|
||||
export class Field extends BaseModel implements Serializable<Field>,FormGenerator<FormGroup>{
|
||||
|
||||
|
@ -24,6 +25,7 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
|
|||
public ordinal: number;
|
||||
public visible: Visibility = new Visibility();
|
||||
public data:DataField<any>;
|
||||
public validation: ValidationTypes;
|
||||
|
||||
fromJSONObject(item:any):Field{
|
||||
this.id = item.id;
|
||||
|
@ -32,6 +34,7 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
|
|||
this.page = item.page;
|
||||
// this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.ordinal = item.ordinal;
|
||||
this.validation = item.validation;
|
||||
this.viewStyle = new JsonSerializer<ViewStyle>().fromJSONObject(item.viewStyle, ViewStyle);
|
||||
this.visible = new JsonSerializer<Visibility>().fromJSONObject(item.visible, Visibility);
|
||||
if(item.data) {
|
||||
|
@ -50,7 +53,8 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
|
|||
id: [this.id],
|
||||
title: [this.title],
|
||||
page:[this.page] ,
|
||||
ordinal:[this.ordinal]
|
||||
ordinal:[this.ordinal],
|
||||
validation:[this.validation]
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue