core/dynamic-forms/checkbox/checkbox.type.component.ts
FieldType
changeDetection | ChangeDetectionStrategy.OnPush |
selector | c8y-field-checkbox |
templateUrl | ./checkbox.type.component.html |
Properties |
|
defaultOptions |
Type : object
|
Default value : {
templateOptions: {
indeterminate: true,
formCheck: 'custom' // 'custom' | 'custom-inline' | 'custom-switch' | 'stacked' | 'inline' | 'nolabel'
}
}
|
<label
[class.c8y-checkbox]="!to.switchMode"
[class.c8y-switch]="to.switchMode"
[class.has-error]="showError">
<input
type="checkbox"
[class.is-invalid]="showError"
[class.form-check-input]="to.formCheck.indexOf('custom') === -1"
[class.position-static]="to.formCheck === 'nolabel'"
[class.custom-control-input]="to.formCheck.indexOf('custom') === 0"
[indeterminate]="to.indeterminate && formControl.value == null"
[formControl]="formControl"
[formlyAttributes]="field"
/><span></span><span> {{ to.label | humanize}} </span>
<span *ngIf="to.required && to.hideRequiredMarker !== true"><em class="m-l-4" translate>(required)</em></span>
<button
*ngIf="!!to.description"
class="btn-clean m-l-4 flex-item-middle"
[popover]="to.description"
placement="auto"
outsideClick="true"
type="button"
>
<i c8yIcon="question-circle-o" class="text-primary"></i>
</button>
</label>