File

src/ui/viewer/components/field/wrappers/checkbox/smart-checkbox-wrapper.component.ts

Extends

AbstractInputWrapperComponent

Metadata

Index

Properties
Methods
Inputs
Outputs

Inputs

componentInstance
Type : any
contentStyle
Type : any
field
Type : any
fieldStyle
Type : any
hasAbsolutePosition
Type : boolean
isNumeric
Type : boolean
model
Type : any
selected
Type : any
showDateTimeZone
Type : boolean
useDateTimeZones
Type : boolean

Outputs

modelChange
Type : EventEmitter<any>

Methods

isDisabled
isDisabled()

Checks if the checkbox is disabled

Returns : boolean

true if the checkbox is disabled, false otherwise

updateCheckboxValue
updateCheckboxValue(value: unknown)

Updates the checkbox value

Parameters :
Name Type Optional Default value Description
value unknown No !this.model

The new checkbox value

Returns : void
Public updateValue
updateValue(newValue: any)
Parameters :
Name Type Optional
newValue any No
Returns : void

Properties

checkboxContainerClick
Type : EventEmitter<void>
Default value : new EventEmitter<void>()
checkboxElement
Type : ElementRef<HTMLInputElement>
Decorators :
@ViewChild('vCheckbox', {read: ElementRef})
Public elementRef
Type : ElementRef
enabledStateDirective
Type : EnabledStateDirective
Decorators :
@ViewChild(EnabledStateDirective)
Public helperService
Type : SmartViewerHelperService<AbstractFrameComponent>
smartWidgetDirective
Type : InputFacadeDirective
Decorators :
@ViewChild(InputFacadeDirective)
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -                  *
* www.consultingwerk.com and other contributors as listed                *
* below. All Rights Reserved.                                            *
*                                                                        *
*  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY        *
*   KIND, either express or implied.                                     *
*                                                                        *
*  Contributors:                                                         *
*                                                                        *
**************************************************************************

--------------------------------------------------------------------------
    File        : smart-checkbox-wrapper.component.html
    Purpose     : Template for Smart Checkbox Wrapper.
    Author(s)   : Radu Nicoara
    Created     : Oct 31, 2024
--------------------------------------------------------------------------
-->
<div #checkboxContainer (click)="checkboxContainerClick.emit()" [ngClass]="{'disabled': isDisabled()}" class="smart-checkbox-container d-flex align-items-center mt-2">
    <input 
        type="checkbox" 
        #vCheckbox
        smart-widget
        [ngModel]="model"
        [checked]="model"
        kendoCheckBox
        (change)="$event.preventDefault()"
        [enabledState]="field.enabledState"
        [name]="field.fieldName"
        (focus)="helperService.inputFocused.next(field.fieldName)"
        (blur)="helperService.inputBlurred.next(field.fieldName)"
        [attr.dataHelpUrl]="field.inputSettings.helpUrl"
        [ngClass]="{'has-help-url': field.inputSettings.helpUrl}">
        @if (!field.inputSettings?.noLabel) {
            <kendo-label class="k-checkbox-label ms-2 mb-0" [text]="field.label" [for]="vCheckbox">
                @if (field.required || field.definition?.mandatory) {
                <span class="k-required smart-field-required">*</span>
                }
            </kendo-label>
        }
</div> 

			.smart-checkbox-container:not(.disabled) {
				cursor: pointer;
			}
			.smart-checkbox-container {
				display: flex !important;
				flex-direction: row !important;
				align-items: center !important;
				gap: var(--kendo-spacing-1, 0.25rem);
				line-height: 1;
			}

			/* Ensure checkbox comes first and label follows */
			.smart-checkbox-container input[type='checkbox'] {
				order: 1;
				margin: 0;
				align-self: center;
			}

			.smart-checkbox-container kendo-label {
				order: 2;
				margin-left: var(--kendo-spacing-2, 0.5rem);
				align-self: center;
				line-height: 1;
			}

			.smart-checkbox-container kendo-label .k-label {
				line-height: 1;
				margin: 0;
				padding: 0;
				align-self: center;
			}

			/* Ensure the form field doesn't interfere with layout */
			.smart-checkbox-container.k-form-field {
				flex-direction: row !important;
				align-items: center !important;
			}

			/* Fix any potential Kendo FormField conflicts */
			.smart-checkbox-container.k-form-field > * {
				align-self: center;
			}
		
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""