build_tools.tui_common.controls.selects ======================================= .. py:module:: build_tools.tui_common.controls.selects .. autoapi-nested-parse:: Custom Select widget with j/k keybindings. This module provides a JKSelect widget that extends Textual's Select widget to support vim-style j/k navigation in addition to arrow keys. Classes ------- .. autoapisummary:: build_tools.tui_common.controls.selects.JKSelectOverlay build_tools.tui_common.controls.selects.JKSelect Module Contents --------------- .. py:class:: JKSelectOverlay(type_to_search = True) Bases: :py:obj:`textual.widgets._select.SelectOverlay` Select overlay with j/k keybinding support. Handles j/k directly in key event processing to provide vim-style navigation in addition to arrow keys. Initialize an OptionList. :param \*content: Positional arguments become the options. :param name: Name of the OptionList. :param id: The ID of the OptionList in the DOM. :param classes: Initial CSS classes. :param disabled: Disable the widget? :param markup: Strips should be rendered as content markup if `True`, or plain text if `False`. :param compact: Enable compact style? .. py:class:: JKSelect(options, *, prompt = 'Select', allow_blank = True, value = NULL, type_to_search = True, name = None, id = None, classes = None, disabled = False, tooltip = None, compact = False) Bases: :py:obj:`textual.widgets.Select` Select widget with vim-style j/k navigation support. Extends the standard Textual Select widget to respond to j/k keys in addition to the standard up/down arrow keys when the dropdown is open. Usage is identical to the standard Select widget: .. code-block:: python yield JKSelect( [("Option 1", "opt1"), ("Option 2", "opt2")], value="opt1", id="my-select", ) Initialize the Select control. :param options: Options to select from. If no options are provided then `allow_blank` must be set to `True`. :param prompt: Text to show in the control when no option is selected. :param allow_blank: Enables or disables the ability to have the widget in a state with no selection made, in which case its value is set to the constant [`Select.NULL`][textual.widgets.Select.NULL]. :param value: Initial value selected. Should be one of the values in `options`. If no initial value is set and `allow_blank` is `False`, the widget will auto-select the first available option. :param type_to_search: If `True`, typing will search for options. :param name: The name of the select control. :param id: The ID of the control in the DOM. :param classes: The CSS classes of the control. :param disabled: Whether the control is disabled or not. :param tooltip: Optional tooltip. :param compact: Enable compact select (without borders). :raises EmptySelectError: If no options are provided and `allow_blank` is `False`. .. py:method:: compose() Compose Select with JKSelectOverlay for j/k navigation.