File

packages/eui/packages/components/eui-input-checkbox/eui-input-checkbox.component.ts

Description

Angular component that provides a custom checkbox input implementation. Extends InputDirective and implements form control functionality.

Extends

InputDirective

Implements

OnInit DoCheck OnChanges ControlValueAccessor

Metadata

Index

Methods
Inputs
Outputs
HostBindings
HostListeners
Accessors

Constructor

constructor()

Inputs

checked
Type : boolean

Controls the checked state of the checkbox.

indeterminate
Type : boolean

Controls the indeterminate (mixed) state of the checkbox. When true, the checkbox appears in an indeterminate state. This state is automatically cleared when the checkbox is clicked.

isInvalid
Type : boolean

Controls the invalid state of the checkbox. Used for displaying validation errors.

disabled
Type : boolean
euiDanger
Type : boolean
Default value : false
euiDisabled
Type : boolean
Default value : false
placeholder
Type : string | null
readonly
Type : any

Outputs

indeterminateChange
Type : EventEmitter<boolean>

Event emitter that fires when the indeterminate state changes.

HostBindings

attr.type
Type : string
Default value : 'checkbox'
class
Type : string

Gets the CSS classes for the checkbox component. Combines base classes with validation state classes.

HostListeners

change
Arguments : '$event.target.checked'
change(checked: boolean)

Event handler for checkbox change events.

Parameters :
Name Optional Description
checked No
  • The new checked state
keydown.space
Arguments : '$event'
keydown.space(event: KeyboardEvent)

Event handler for space key press. Prevents space key action when checkbox is readonly.

Parameters :
Name Optional Description
event No
  • The keyboard event

Methods

registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
Optional setDisabledState
setDisabledState(isDisabled: boolean)
Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
writeValue
writeValue(obj: boolean)

Implements ControlValueAccessor writeValue method. Updates the checked state of the checkbox.

Parameters :
Name Type Optional Description
obj boolean No
  • The value to write
Returns : void
getCssClasses
getCssClasses(rootClass: string)
Parameters :
Name Type Optional
rootClass string No
Returns : string

Accessors

cssClasses
getcssClasses()

Gets the CSS classes for the checkbox component. Combines base classes with validation state classes.

Returns : string
indeterminate
getindeterminate()

Controls the indeterminate (mixed) state of the checkbox. When true, the checkbox appears in an indeterminate state. This state is automatically cleared when the checkbox is clicked.

Returns : boolean
setindeterminate(value: BooleanInput)
Parameters :
Name Type Optional
value BooleanInput No
Returns : void
isInvalid
getisInvalid()

Controls the invalid state of the checkbox. Used for displaying validation errors.

Returns : boolean
setisInvalid(state: any)
Parameters :
Name Type Optional
state any No
Returns : void
checked
getchecked()

Controls the checked state of the checkbox.

Returns : boolean
setchecked(value: BooleanInput)
Parameters :
Name Type Optional
value BooleanInput No
Returns : void

results matching ""

    No results matching ""