Skip to content

Commit

Permalink
Merge 6248e62 into 43595f2
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Feb 14, 2022
2 parents 43595f2 + 6248e62 commit 4809ee3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
9 changes: 7 additions & 2 deletions packages/form/src/sf-item.component.ts
Expand Up @@ -5,6 +5,7 @@ import {
OnChanges,
OnDestroy,
OnInit,
TemplateRef,
ViewChild,
ViewContainerRef,
ViewEncapsulation
Expand All @@ -23,7 +24,10 @@ let nextUniqueId = 0;
selector: 'sf-item',
exportAs: 'sfItem',
host: { '[class.sf__item]': 'true' },
template: ` <ng-template #target></ng-template> `,
template: `
<ng-template #target></ng-template>
<ng-container *ngTemplateOutlet="footer"></ng-container>
`,
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None
})
Expand All @@ -33,9 +37,10 @@ export class SFItemComponent implements OnInit, OnChanges, OnDestroy {
widget: Widget<FormProperty, SFUISchemaItem> | null = null;

@Input() formProperty!: FormProperty;
@Input() footer: TemplateRef<void> | null = null;

@ViewChild('target', { read: ViewContainerRef, static: true })
container!: ViewContainerRef;
private container!: ViewContainerRef;

constructor(private widgetFactory: WidgetFactory, private terminator: TerminatorService) {}

Expand Down
6 changes: 4 additions & 2 deletions packages/form/src/sf.component.html
@@ -1,8 +1,7 @@
<ng-template #con>
<ng-content></ng-content>
</ng-template>
<form nz-form [nzLayout]="layout" (submit)="onSubmit($event)" [attr.autocomplete]="autocomplete">
<sf-item *ngIf="rootProperty" [formProperty]="rootProperty"></sf-item>
<ng-template #btnTpl>
<ng-container *ngIf="button !== 'none'; else con">
<nz-form-item
*ngIf="_btn && _btn.render"
Expand Down Expand Up @@ -70,4 +69,7 @@
</div>
</nz-form-item>
</ng-container>
</ng-template>
<form nz-form [nzLayout]="layout" (submit)="onSubmit($event)" [attr.autocomplete]="autocomplete">
<sf-item *ngIf="rootProperty" [formProperty]="rootProperty" [footer]="btnTpl"></sf-item>
</form>
10 changes: 1 addition & 9 deletions packages/form/src/style/index.less
Expand Up @@ -110,15 +110,6 @@
}
}

&__checkbox-list {
display: block;
width: 100%;
@media (min-width: @mobile-min) {
.@{ant-prefix}-col {
margin-top: 8px;
}
}
}
// upload
.@{ant-prefix}-upload-select-picture-card i {
color: #999;
Expand Down Expand Up @@ -184,6 +175,7 @@
}

&-btns {
display: inline-block;
margin-right: 0;
}
}
Expand Down

0 comments on commit 4809ee3

Please sign in to comment.