File

packages/eui/packages/components/eui-textarea/eui-textarea.component.ts

Description

A form control component that provides an enhanced textarea with additional features. Supports readonly state visualization, form control integration, and state management.

Implements

OnInit OnDestroy DoCheck OnChanges ControlValueAccessor

Metadata

Index

Properties
Methods
Inputs
Outputs
HostBindings
HostListeners
Accessors

Constructor

constructor()

Inputs

disabled
Type : boolean | null

The disabled state of the textarea This can be controlled either directly or through form control binding.

e2eAttr
Type : string
Default value : 'eui-textarea'
id
Type : string
Default value : `eui-textarea_${EuiTextareaComponent.idCounter++}`

Unique identifier for the textarea

isInvalid
Type : boolean

Flag indicating if the textarea is in an invalid state This can be set manually or automatically through form validation.

readonly
Type : any

The readonly state of the textarea with special styling.

Outputs

rowsChange
Type : EventEmitter

Event emitter that fires when the number of text rows in the textarea changes

HostBindings

class
Type : string

HostListeners

blur
Arguments : '$event.target.value'
blur(value: string)

Handles blur events on the textarea

Parameters :
Name Optional Description
value No
  • The current value of the textarea
input
Arguments : '$event.target.value'
input(value: string)

Handles input changes in the textarea

Parameters :
Name Optional Description
value No
  • The new value of the textarea

Methods

Public onBlur
onBlur(value: string)
Decorators :
@HostListener('blur', ['$event.target.value'])

Handles blur events on the textarea

Parameters :
Name Type Optional Description
value string No
  • The current value of the textarea
Returns : void
Public onInputChange
onInputChange(value: string)
Decorators :
@HostListener('input', ['$event.target.value'])

Handles input changes in the textarea

Parameters :
Name Type Optional Description
value string No
  • The new value of the textarea
Returns : void
registerOnChange
registerOnChange(fn: () => void)

Registers the callback function for change events

Parameters :
Name Type Optional Description
fn function No
  • The callback function
Returns : void
registerOnTouched
registerOnTouched(fn: () => void)

Registers the callback function for touched events

Parameters :
Name Type Optional Description
fn function No
  • The callback function
Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)

Sets the disabled state of the textarea

Parameters :
Name Type Optional Description
isDisabled boolean No
  • The disabled state to set
Returns : void
writeValue
writeValue(obj)

ControlValueAccessor implementation for writing values

Parameters :
Name Optional Description
obj No
  • The value to write to the textarea
Returns : void

Properties

Static idCounter
Type : number
Default value : 0

Static counter used to generate unique IDs for textarea instances

Accessors

class
getclass()
disabled
getdisabled()

The disabled state of the textarea This can be controlled either directly or through form control binding.

Returns : boolean | null
setdisabled(state: any)
Parameters :
Name Type Optional
state any No
Returns : void
readonly
getreadonly()

The readonly state of the textarea with special styling.

Returns : any
setreadonly(state: any)
Parameters :
Name Type Optional
state any No
Returns : void

results matching ""

    No results matching ""