Documentation ¶
Overview ¶
Package list provides a generic list implementation to be used inside BubbleTea-based dialog components.
Index ¶
- type Entries
- type Entry
- type List
- func (self *List[S]) Aborted() bool
- func (self *List[S]) EntryNumberStr(number int) string
- func (self *List[S]) HandleKey(key tea.KeyMsg) (bool, tea.Cmd)
- func (self *List[S]) MoveCursorDown()
- func (self *List[S]) MoveCursorUp()
- func (self *List[S]) MovePageDown()
- func (self *List[S]) MovePageUp()
- func (self List[S]) SelectedData() S
- func (self List[S]) SelectedEntry() Entry[S]
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entries ¶
Entries provides methods for a collection of Entry instances.
func NewEntries ¶
NewEnabledListEntries creates Entries for the given data types.
func (Entries[S]) AllDisabled ¶
AllDisabled indicates whether all entries in this list are disabled.
func (Entries[S]) IndexWithText ¶
IndexWithText provides the index of the element with the given text.
type List ¶
type List[S fmt.Stringer] struct { Colors colors.DialogColors // colors to use for help text Cursor int // index of the currently selected row Entries Entries[S] // the entries to select from EntryNumber string // the manually entered entry number MaxDigits int // how many digits make up an entry number NumberFormat string // template for formatting the entry number Status Status }
List contains elements and operations common to all BubbleTea-based list implementations.
func (*List[S]) EntryNumberStr ¶
EntryNumberStr provides a colorized string to print the given entry number.
func (*List[S]) MoveCursorDown ¶
func (self *List[S]) MoveCursorDown()
func (*List[S]) MoveCursorUp ¶
func (self *List[S]) MoveCursorUp()
func (*List[S]) MovePageDown ¶
func (self *List[S]) MovePageDown()
func (*List[S]) MovePageUp ¶
func (self *List[S]) MovePageUp()
func (List[S]) SelectedData ¶
func (self List[S]) SelectedData() S
func (List[S]) SelectedEntry ¶
Click to show internal directories.
Click to hide internal directories.