Skip to content

Commit

Permalink
fix(module:sf): fix button spanLabelFixed is zero value (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Oct 30, 2018
1 parent fe6d104 commit 1f601e2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/form/src/sf.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<sf-item [formProperty]="rootProperty"></sf-item>
<ng-container *ngIf="button !== 'none'; else con">
<nz-form-item [ngClass]="_btn.render.class" class="sf-btns" [fixed-label]="_btn.render.spanLabelFixed">
<nz-col class="ant-form-item-control-wrapper" [nzSpan]="_btn.render.grid.span" [nzOffset]="_btn.render.grid.offset"
<div nz-col class="ant-form-item-control-wrapper" [nzSpan]="_btn.render.grid.span" [nzOffset]="_btn.render.grid.offset"
[nzXs]="_btn.render.grid.xs" [nzSm]="_btn.render.grid.sm" [nzMd]="_btn.render.grid.md"
[nzLg]="_btn.render.grid.lg" [nzXl]="_btn.render.grid.xl">
[nzLg]="_btn.render.grid.lg" [nzXl]="_btn.render.grid.xl" [nzXXl]="_btn.render.grid.xxl">
<div class="ant-form-item-control">
<ng-container *ngIf="button; else con">
<button type="submit" nz-button [nzType]="_btn.submit_type" [disabled]="liveValidate && !valid">{{_btn.submit}}</button>
<button *ngIf="_btn.reset" (click)="reset(true)" type="button" nz-button [nzType]="_btn.reset_type">{{_btn.reset}}</button>
</ng-container>
</div>
</nz-col>
</div>
</nz-form-item>
</ng-container>
</form>
2 changes: 1 addition & 1 deletion packages/form/src/sf.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy {
};
}
// fixed label
if (!this._btn.render.spanLabelFixed) {
if (this._btn.render.spanLabelFixed == null) {
this._btn.render.spanLabelFixed = btnUi.spanLabelFixed;
}
// 固定标签宽度时,若不指定样式,则默认居中
Expand Down
8 changes: 4 additions & 4 deletions packages/form/src/widgets/object/object.widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import { FormProperty } from '../../model/form.property';
selector: 'sf-object',
template: `
<ng-container *ngIf="grid; else noGrid">
<nz-row [nzGutter]="grid.gutter">
<div nz-row [nzGutter]="grid.gutter">
<ng-container *ngFor="let i of list">
<ng-container *ngIf="i.property.visible && i.show">
<nz-col
<div nz-col
[nzSpan]="i.grid.span" [nzOffset]="i.grid.offset"
[nzXs]="i.grid.xs" [nzSm]="i.grid.sm" [nzMd]="i.grid.md"
[nzLg]="i.grid.lg" [nzXl]="i.grid.xl" [nzXXl]="i.grid.xxl">
<sf-item [formProperty]="i.property" [fixed-label]="i.spanLabelFixed"></sf-item>
</nz-col>
</div>
</ng-container>
</ng-container>
</nz-row>
</div>
</ng-container>
<ng-template #noGrid>
<ng-container *ngFor="let i of list">
Expand Down
5 changes: 5 additions & 0 deletions packages/theme/styles/app/delon/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@
}
}
}
&__no-error {
.ant-form-item {
margin-bottom: 8px;
}
}
}

0 comments on commit 1f601e2

Please sign in to comment.