Raxol. UI. Components. Input. SelectList. Utils
(Raxol v2.6.0)
View Source
Shared utility functions for SelectList component modules. Eliminates code duplication between Navigation and Selection modules.
Summary
Functions
Ensures that the selected item is visible within the scroll viewport. Adjusts scroll_offset to bring the selected item into view.
Filters options by a search query (case-insensitive substring match). Returns all options when query is empty.
Gets the effective options based on current filter/search state. Returns filtered_options if present, otherwise the full options list.
Extracts a display label from a SelectList option. Handles strings, tuples, and maps with :label, :text, :name, or :value keys.
Functions
@spec ensure_visible(Raxol.UI.Components.Input.SelectList.t()) :: Raxol.UI.Components.Input.SelectList.t()
Ensures that the selected item is visible within the scroll viewport. Adjusts scroll_offset to bring the selected item into view.
Filters options by a search query (case-insensitive substring match). Returns all options when query is empty.
@spec get_effective_options(Raxol.UI.Components.Input.SelectList.t()) :: list()
Gets the effective options based on current filter/search state. Returns filtered_options if present, otherwise the full options list.
Extracts a display label from a SelectList option. Handles strings, tuples, and maps with :label, :text, :name, or :value keys.