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