Interface: CosmographSearchConfigInterface<T>
Extends
Omit<SearchConfigInterface<T>,"placeholderRenderer"|"footerComponent"|"searchFn">
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
truemultifieldSearch?
optionalmultifieldSearch:boolean
Whether to search across all fields in the table, not just the accessor field. When enabled, accessor field matches will have priority over other field matches.
Default
falsesuggestionFields?
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'],
suggestionTruncationLength?
optionalsuggestionTruncationLength:number
Maximum number of characters to show before and after a search match in suggestions. If the result is longer than this limit, it will be truncated with ”…” to indicate truncation. Set to 0 to disable truncation and show full text.
Default
50preserveSelectionOnUnmount?
optionalpreserveSelectionOnUnmount:boolean
Preserves the selection on unmount.
Default
falseshowFooter?
optionalshowFooter:boolean
Whether to show footer with “Select all results” button and the counter of results below the search suggestion dropdown. When enabled, displays a footer below the suggestion list.
Default
falseonSelectAll()?
optionalonSelectAll: (suggestionIndexes) =>void
Callback triggered when all suggestions from the results are selected using the “Select all results” button.
Parameters
| Parameter | Type | Description |
|---|---|---|
suggestionIndexes | undefined | number[] | An array of selected suggestion indexes or undefined if no suggestions are selected |
Returns
void
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
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
onClear()?
optionalonClear: () =>void
Callback invoked when the clear button is clicked.
Returns
void
Inherited from
Omit.onClear
highlightMatch?
optionalhighlightMatch:boolean
Whether to highlight the matching text in the suggestions.
Default
trueInherited from
Omit.highlightMatch
noResultsText?
optionalnoResultsText:null|string
Text to display when no search results are found. Set to null to hide the no results message.
Default
'No results found'Inherited from
Omit.noResultsText