Feature/form improvements (#1707)

* adding more options for form

* added form requied and info for item
This commit is contained in:
Leila Lali
2018-06-21 15:26:52 -07:00
committed by GitHub
parent f5b147ca4b
commit 1871fd383e
4 changed files with 57 additions and 3 deletions

View File

@@ -255,6 +255,9 @@ class FormContainerBuilder extends ContainerBuilderImpl<sqlops.FormContainer, sq
private convertToItemConfig(formComponent: sqlops.FormComponent, itemLayout?: sqlops.FormItemLayout): InternalItemConfig {
let componentWrapper = formComponent.component as ComponentWrapper;
if (itemLayout && itemLayout.required && componentWrapper) {
componentWrapper.required = true;
}
let actions: string[] = undefined;
if (formComponent.actions) {
actions = formComponent.actions.map(action => {
@@ -400,6 +403,13 @@ class ComponentWrapper implements sqlops.Component {
this.setProperty('width', v);
}
public get required(): boolean {
return this.properties['required'];
}
public set required(v: boolean) {
this.setProperty('required', v);
}
public toComponentShape(): IComponentShape {
return <IComponentShape>{
id: this.id,