EditorSearchComponent
Extends
Properties
app
app:
App
Reference to the app
Inherited from
containerEl
containerEl:
HTMLElement
The container element in which the search component exists (i.e. Editor)
Inherited from
AbstractSearchComponent
.containerEl
cursor
cursor:
null
|SearchCursor
Search cursor for editor, handles search and replace functionality for editor
editor
editor:
Editor
Linked editor for search component
isActive
isActive:
boolean
Whether search component is currently rendering
isReplace
isReplace:
boolean
Whether search component is replacing text (includes ‘Replace’ input field)
replaceInputEl
replaceInputEl:
HTMLInputElement
Container for the replacement input field
Inherited from
AbstractSearchComponent
.replaceInputEl
scope
scope:
Scope
Keyscope for search component
Inherited from
searchButtonContainerEl
searchButtonContainerEl:
HTMLElement
Container for all the action buttons
Inherited from
AbstractSearchComponent
.searchButtonContainerEl
searchContainerEl
searchContainerEl:
HTMLElement
Container for the search component itself
Inherited from
AbstractSearchComponent
.searchContainerEl
searchInputEl
searchInputEl:
HTMLInputElement
Container for the search input field
Inherited from
AbstractSearchComponent
.searchInputEl
Methods
clear()
clear():
void
Remove all highlights from editor
Returns
void
findNext()
findNext():
void
Find next search results from cursor and highlights it
Returns
void
findNextOrReplace()
findNextOrReplace():
void
Replace cursor with replacement string if not null and moves to next search result
Returns
void
findPrevious()
findPrevious():
void
Find previous search results from cursor and highlights it
Returns
void
getQuery()
getQuery():
string
Returns the current search query
Returns
string
Inherited from
AbstractSearchComponent
.getQuery
goToNextInput()
goToNextInput(
event
):unknown
Switch to the next inputElement
Parameters
• event: KeyboardEvent
Returns
unknown
Inherited from
AbstractSearchComponent
.goToNextInput
hide()
hide():
void
Hide/detaches the search component and removes cursor highlights
Returns
void
highlight()
highlight(
ranges
):void
Add highlights for specified ranges
Parameters
• ranges: EditorRange
[]
Returns
void
onAltEnter()
onAltEnter(
e
?):void
Highlights all matches if search element focused
Parameters
• e?: KeyboardEvent
Returns
void
onEnter()
onEnter(
event
):unknown
Invokes findNextOrReplace
Parameters
• event: KeyboardEvent
Returns
unknown
Inherited from
AbstractSearchComponent
.onEnter
onModAltEnter()
onModAltEnter(
e
?):void
Replace all search results with specified text if replace mode and replacement element is focused
Parameters
• e?: KeyboardEvent
Returns
void
onSearchInput()
onSearchInput():
void
Updates search cursor on new input query and highlights search results
Returns
void
onShiftEnter()
onShiftEnter(
event
):unknown
Invokes findPrevious
Parameters
• event: KeyboardEvent
Returns
unknown
Inherited from
AbstractSearchComponent
.onShiftEnter
replaceAll()
replaceAll():
void
Replaces all search results with replacement query
Returns
void
replaceCurrentMatch()
replaceCurrentMatch():
void
Replace current search result, if any, with replacement query
Returns
void
searchAll()
searchAll():
void
Find all matches of search query and highlights them
Returns
void
show()
show(
replace
):void
Reveal the search (and replace) component
Parameters
• replace: boolean
Returns
void