Skip to content

Commit

Permalink
form should not default to100% by default (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
llali authored Jun 19, 2018
1 parent 6b018c5 commit c13f219
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/sql/parts/modelComponents/flexContainer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FlexItem {
template: `
<div *ngIf="items" class="flexContainer" [style.flexFlow]="flexFlow" [style.justifyContent]="justifyContent"
[style.alignItems]="alignItems" [style.alignContent]="alignContent" [style.height]="height" [style.width]="width">
<div *ngFor="let item of items" [style.flex]="getItemFlex(item)" [style.order]="getItemOrder(item)" >
<div *ngFor="let item of items" [style.flex]="getItemFlex(item)" [style.textAlign]="textAlign" [style.order]="getItemOrder(item)" >
<model-component-wrapper [descriptor]="item.descriptor" [modelStore]="modelStore">
</model-component-wrapper>
</div>
Expand All @@ -40,6 +40,7 @@ export default class FlexContainer extends ContainerBase<FlexItemLayout> impleme
private _justifyContent: string;
private _alignItems: string;
private _alignContent: string;
private _textAlign: string;
private _height: string;
private _width: string;

Expand All @@ -65,6 +66,7 @@ export default class FlexContainer extends ContainerBase<FlexItemLayout> impleme
this._justifyContent = layout.justifyContent ? layout.justifyContent : '';
this._alignItems = layout.alignItems ? layout.alignItems : '';
this._alignContent = layout.alignContent ? layout.alignContent : '';
this._textAlign = layout.textAlign ? layout.textAlign : '';
this._height = this.convertSize(layout.height);
this._width = this.convertSize(layout.width);

Expand Down Expand Up @@ -96,6 +98,10 @@ export default class FlexContainer extends ContainerBase<FlexItemLayout> impleme
return this._alignContent;
}

public get textAlign(): string {
return this._textAlign;
}

private getItemFlex(item: FlexItem): string {
return item.config ? item.config.flex : '1 1 auto';
}
Expand Down
4 changes: 2 additions & 2 deletions src/sql/parts/modelComponents/formContainer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
}

private getFormWidth(): string {
return this.convertSize(this._formLayout && this._formLayout.width, '100%');
return this.convertSize(this._formLayout && this._formLayout.width, '');
}

private getFormHeight(): string {
return this.convertSize(this._formLayout && this._formLayout.height, '100%');
return this.convertSize(this._formLayout && this._formLayout.height, '');
}

private getComponentWidth(item: FormItem): string {
Expand Down
5 changes: 5 additions & 0 deletions src/sql/sqlops.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ declare module 'sqlops' {
* Container Width
*/
width?: number | string;

/**
*
*/
textAlign?: string
}

export interface FlexItemLayout {
Expand Down

0 comments on commit c13f219

Please sign in to comment.