Interface: CosmographSearchConfigInterface<T>
Extends
Omit<SearchConfigInterface<T>,"placeholderRenderer">
Extended by
Type Parameters
| Type Parameter | 
|---|
T | 
Properties
accessor?
optionalaccessor:string
Data column key to access time values for the CosmographSearch. Make sure itâs included in pointIncludeColumns if youâre not using this column as other point accessor.
Default
undefinedplaceholderText?
optionalplaceholderText:string
The text to display in the search input placeholder.
Default
'Search...'showAccessorsMenu?
optionalshowAccessorsMenu:boolean
Whether to show the accessors menu.
Default
truesuggestionFields?
optionalsuggestionFields:Record<string,string>
A map of field names (accessors) to their display labels for the suggestion list.
The order of fields in the map determines the display order in the suggestion.
If provided, the suggestion renderer will display these fields and their values.
The main accessor will be added first if not present in this map.
Example: { âidâ: âPoint IDâ, âweightâ: âWeightâ }
Default
undefinedsuggestionFieldsPalette?
optionalsuggestionFieldsPalette:string[]
An array of CSS-valid colors to use for the suggestion fields. Colors will be applied in order and cycled through if not enough colors are provided.
Default
['#fbb4aebf', '#b3cde3bf', '#ccebc5bf', '#decbe4bf', '#fed9a6bf', '#ffffccbf', '#e5d8bdbf', '#fddaecbf'],
disabled?
optionaldisabled:boolean
Whether the search component is disabled.
Default
falseInherited from
Omit.disabled
openListUpwards?
optionalopenListUpwards:boolean
Whether to open the suggestion list above the input field instead of below.
Default
falseInherited from
Omit.openListUpwards
onInput()?
optionalonInput: (value,results,event) =>void
Callback invoked when the input value changes. This callback should be used to process the query, retrieve matching items, and return them.
Parameters
| Parameter | Type | Description | 
|---|---|---|
value | string | The current value of the input field | 
results | T[] | An array of found items of type T matching the current query | 
event | InputEvent | The input event object | 
Returns
void
Inherited from
Omit.onInput
debounceTime?
optionaldebounceTime:number
The debounce duration (in milliseconds) used to delay the onInput callback. Helps prevent excessive callback invocations during rapid typing.
Default
300Inherited from
Omit.debounceTime
searchFn()?
optionalsearchFn: (query,limit?) =>Promise<T[]>
Function that asynchronously retrieves suggestion items based on the search query. This function should process the query to find specific items in the data. The results are then returned to be used in onInput and onEnter callbacks.
Parameters
| Parameter | Type | Description | 
|---|---|---|
query | string | The current search query | 
limit? | number | Optional. The maximum number of suggestion items to return | 
Returns
Promise<T[]>
A promise that resolves to an array of suggestion items of type T
Inherited from
Omit.searchFn
suggestionsLimit?
optionalsuggestionsLimit:number
The maximum number of suggestions to retrieve and include in the results. When the number of suggestions exceeds this limit, the rest will be omitted. This can be tweaked to improve performance when dealing with large data sets.
Default
50Inherited from
Omit.suggestionsLimit
maxVisibleItems?
optionalmaxVisibleItems:number
The maximum items visible in the suggestions dropdown at once. When the number of suggestions exceeds this value, a scrollbar will be added.
Default
10Inherited from
Omit.maxVisibleItems
onSelect()?
optionalonSelect: (suggestion) =>void
Callback triggered when a suggestion from the autosuggest list is selected.
Parameters
| Parameter | Type | Description | 
|---|---|---|
suggestion | T | The selected suggestion item of type T | 
Returns
void
Inherited from
Omit.onSelect
suggestionRenderer()?
optionalsuggestionRenderer: (suggestion,value?) =>string|HTMLElement
Customize how each suggestion is rendered.
Parameters
| Parameter | Type | Description | 
|---|---|---|
suggestion | T | The suggestion item of type T to render | 
value? | string | - | 
Returns
string | HTMLElement
A string containing HTML or an HTMLElement representing the rendered suggestion
Inherited from
Omit.suggestionRenderer
selectedSuggestionRenderer()?
optionalselectedSuggestionRenderer: (suggestion,value?) =>string
Function to convert a suggestion item to a string for display in the input field after selection.
Parameters
| Parameter | Type | Description | 
|---|---|---|
suggestion | T | The suggestion item to convert | 
value? | string | The current value of the input field | 
Returns
string
The string representation of the suggestion
Inherited from
Omit.selectedSuggestionRenderer
inputClassName?
optionalinputClassName:string
Custom CSS class name to apply to the search input field.
Default
undefinedInherited from
Omit.inputClassName
suggestionListClassName?
optionalsuggestionListClassName:string
Custom CSS class name to apply to the autosuggest list container.
Default
undefinedInherited from
Omit.suggestionListClassName
minSearchLength?
optionalminSearchLength:number
The minimum number of characters required to trigger a search.
Default
2Inherited from
Omit.minSearchLength
onEnter()?
optionalonEnter: (value,results) =>void
Callback invoked when the return (Enter) key is pressed. This callback should process the current input value to find the matching items and return them.
Parameters
| Parameter | Type | Description | 
|---|---|---|
value | string | The current value of the input field when Enter is pressed | 
results | T[] | An array of found items of type T matching the current query | 
Returns
void
Inherited from
Omit.onEnter
highlightMatch?
optionalhighlightMatch:boolean
Whether to highlight the matching text in the suggestions.
Default
trueInherited from
Omit.highlightMatch