File

qwc/projects/qwc/src/lib/components/qwc-search-input/qwc-search-input.component.ts

Description

A text field like component specifically used for input of "Search as you type" text. Emits user typed text after debouncing by 200ms

Implements

OnInit OnChanges ControlValueAccessor

Metadata

providers { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => QwcSearchInputComponent), multi: true }
selector qwc-search-input
templateUrl qwc-search-input.component.html

Index

Properties
Methods
Inputs
Outputs

Inputs

multiLineInput
Default value : false
placeholder
Default value : "Search"
preventEnter
Default value : false
value
Default value : ""

Outputs

valueChanged
Type : EventEmitter

Methods

clear
clear()

Clear

Returns : void

void

ngOnChanges
ngOnChanges(changes: SimpleChanges)

Component lifecycle hook for input changes

Parameters :
Name Type Optional Description
changes SimpleChanges No
  • SimpleChanges object
Returns : void

void

ngOnInit
ngOnInit()

Component lifecycle hook Emit new value when input field's text changes.

Returns : void

void

onBlur
onBlur()

On blur

Returns : void

void

onFocus
onFocus()

On focus

Returns : void

void

onInput
onInput(searchText: string)

Handles the input event of the search input.

Parameters :
Name Type Optional Description
searchText string No
  • Search text
Returns : void

void

onKeyDown
onKeyDown(event: KeyboardEvent)

Handles the keydown event of the search input.

Parameters :
Name Type Optional Description
event KeyboardEvent No
  • The keydown event object.
Returns : void

void

onPaste
onPaste(event: any)

Handles the paste event for the search input.

Parameters :
Name Type Optional Description
event any No
  • The paste event object.
Returns : void

void

registerOnChange
registerOnChange(fn: (value: string) => void)

Registers a callback function that is called when the control's value changes.

Parameters :
Name Type Optional Description
fn function No
  • The callback function
Returns : void

void

registerOnTouched
registerOnTouched(fn: () => void)

Registers a callback function that is called when the control is touched.

Parameters :
Name Type Optional Description
fn function No
  • The callback function
Returns : void

void

writeValue
writeValue(value: string)

Writes a new value to the element.

Parameters :
Name Type Optional Description
value string No
  • The new value
Returns : void

void

Properties

_searchText
Type : string
Default value : ""
guid
Default value : Date.now()
isCancelBtnHidden
Default value : true

Clear button visibility flag for deleting input text

isFocussed
Default value : false
queryField
Type : FormControl
Default value : new FormControl()

result-matching ""

    No results matching ""