ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
53 lines (52 loc) • 2.03 kB
HTML
<ng-template #all>
<label
*ngIf="ui.checkAll"
nz-checkbox
class="sf__checkbox-all mr-sm"
[(ngModel)]="allChecked"
(ngModelChange)="onAllChecked()"
[nzIndeterminate]="indeterminate"
>{{ ui.checkAllText || l.checkAllText }}</label
>
</ng-template>
<sf-item-wrap [id]="id" [schema]="schema" [ui]="ui" [showError]="showError" [error]="error" [showTitle]="true" [title]="labelTitle">
<ng-container *ngIf="inited && data.length === 0">
<label nz-checkbox [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="_setValue($event)">
{{schema.title}}
<span class="sf__optional">
{{ ui.optional }}
<i
*ngIf="oh"
nz-tooltip
[nzTooltipTitle]="oh.text"
[nzTooltipPlacement]="oh.placement"
[nzTooltipTrigger]="oh.trigger"
[nzTooltipOverlayClassName]="oh.overlayClassName"
[nzTooltipOverlayStyle]="oh.overlayStyle"
[nzTooltipMouseEnterDelay]="oh.mouseEnterDelay"
[nzTooltipMouseLeaveDelay]="oh.mouseLeaveDelay"
nz-icon
[nzType]="oh.icon"
></i>
</span>
</label>
</ng-container>
<ng-container *ngIf="inited && data.length > 0">
<ng-container *ngIf="grid_span === 0">
<ng-template [ngTemplateOutlet]="all"></ng-template>
<nz-checkbox-group [ngModel]="data" (ngModelChange)="notifySet()"></nz-checkbox-group>
</ng-container>
<ng-container *ngIf="grid_span !== 0">
<nz-checkbox-wrapper class="sf__checkbox-list" (nzOnChange)="groupInGridChange($event)">
<div nz-row>
<div nz-col [nzSpan]="grid_span" *ngIf="ui.checkAll">
<ng-template [ngTemplateOutlet]="all"></ng-template>
</div>
<div nz-col [nzSpan]="grid_span" *ngFor="let i of data">
<label nz-checkbox [nzValue]="i.value" [ngModel]="i.checked" [nzDisabled]="i.disabled">{{i.label}}</label>
</div>
</div>
</nz-checkbox-wrapper>
</ng-container>
</ng-container>
</sf-item-wrap>