Search
This module contains widgets for implementing work item search functionality.
DataTableSearchInput
- class DataTableSearchInput(placeholder: str | None = None, border_title: str | None = None, hide: bool | None = True)
Bases:
textual.widgets.InputAn input field that allows users to perform searches in the currently active search results page.
The feature to search within search results pages is controlled by these settings:
search_results_page_filtering_enabledsearch_results_page_filtering_minimum_term_length
Initialization
Initialise the
Inputwidget.- Parameters:
value – An optional default value for the input.
placeholder – Optional placeholder text for the input.
highlighter – An optional highlighter for the input.
password – Flag to say if the field should obfuscate its content.
restrict – A regex to restrict character inputs.
type – The type of the input.
max_length – The maximum length of the input, or 0 for no maximum length.
suggester – [Suggester][textual.suggester.Suggester] associated with this input instance.
validators – An iterable of validators that the Input value will be checked against.
validate_on – Zero or more of the values “blur”, “changed”, and “submitted”, which determine when to do input validation. The default is to do validation for all messages.
valid_empty – Empty values are valid.
select_on_focus – Whether to select all text on focus.
name – Optional name for the input widget.
id – Optional ID for the widget.
classes – Optional initial classes for the widget.
disabled – Whether the input is disabled or not.
tooltip – Optional tooltip.
compact – Enable compact style (without borders).
IssuesSearchResultsTable
- class IssuesSearchResultsTable
Bases:
textual.widgets.DataTableThe widget that displays the results of a search.
This widget provides a reactive attribute,
search_results, that contains the issues that the table will display.The widget can post a message of type
IssuesSearchResultsTable.WorkItemDeletedwhen the user deletes an item from the table.Important
Deleting an item will delete the item from Jira. After a successful deletion the datatable will remove the row related to the item that was deleted. In addition, the widget will send the message
IssuesSearchResultsTable.WorkItemDeletedto notify other widgets so they can update the relevant widgets.Initialization
Initializes a widget to display tabular data.
- Parameters:
show_header – Whether the table header should be visible or not.
show_row_labels – Whether the row labels should be shown or not.
fixed_rows – The number of rows, counting from the top, that should be fixed and still visible when the user scrolls down.
fixed_columns – The number of columns, counting from the left, that should be fixed and still visible when the user scrolls right.
zebra_stripes – Enables or disables a zebra effect applied to the background color of the rows of the table, where alternate colors are styled differently to improve the readability of the table.
header_height – The height, in number of cells, of the data table header.
show_cursor – Whether the cursor should be visible when navigating the data table or not.
cursor_foreground_priority – If the data associated with a cell is an arbitrary renderable with a set foreground color, this determines whether that color is prioritized over the cursor component class or not.
cursor_background_priority – If the data associated with a cell is an arbitrary renderable with a set background color, this determines whether that color is prioritized over the cursor component class or not.
cursor_type – The type of cursor to be used when navigating the data table with the keyboard.
cell_padding – The number of cells added on each side of each column. Setting this value to zero will likely make your table very hard to read.
name – The name of the widget.
id – The ID of the widget in the DOM.
classes – The CSS classes for the widget.
disabled – Whether the widget is disabled or not.
- watch_search_results(response: jiratui.models.JiraIssueSearchResponse | None = None) None
Watches the content of a reactive attribute that contains the details of the work item selected by the user.
- Parameters:
response – an instance of JiraIssueSearchResponse with the work item selected by the user.
- Returns:
None
- on_data_table_row_selected(event: textual.widgets.DataTable.RowSelected) None
Fetches the details of the currently-selected item.
SearchResultsContainer
- class SearchResultsContainer(*args, **kwargs)
Bases:
textual.containers.ContainerThe container that holds the DataTable widget with the search results.
This widget provides a reactive attribute called
pagination. The attribute accepts a dictionary with the details of the search results’ pagination. This includescurrent_page_numberandtotal. When this attribute is updated the widget will update the legend in the border subtitle to display the number of results and the page number.Initialization
Initialize a Widget.
- Parameters:
children – Child widgets.
name – The name of the widget.
id – The ID of the widget in the DOM.
classes – The CSS classes for the widget.
disabled – Whether the widget is disabled or not.
markup – Enable content markup?