Documentation ¶
Index ¶
- type ActiveMsg
- type IdentifiableItem
- type ItemDelegate
- type SelectMsg
- type Selector
- func (s *Selector) DisableQuitKeybindings()
- func (s *Selector) Index() int
- func (s *Selector) Init() tea.Cmd
- func (s *Selector) Page() int
- func (s *Selector) PerPage() int
- func (s *Selector) Select(index int)
- func (s *Selector) SelectItem() tea.Msg
- func (s *Selector) SetFilteringEnabled(enabled bool)
- func (s *Selector) SetItems(items []IdentifiableItem) tea.Cmd
- func (s *Selector) SetPage(page int)
- func (s *Selector) SetShowFilter(show bool)
- func (s *Selector) SetShowHelp(show bool)
- func (s *Selector) SetShowPagination(show bool)
- func (s *Selector) SetShowStatusBar(show bool)
- func (s *Selector) SetShowTitle(show bool)
- func (s *Selector) SetSize(width, height int)
- func (s *Selector) TotalPages() int
- func (s *Selector) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (s *Selector) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveMsg ¶
type ActiveMsg struct{ IdentifiableItem }
ActiveMsg is a message that is sent when an item is active but not selected.
type IdentifiableItem ¶
type IdentifiableItem interface { list.DefaultItem ID() string }
IdentifiableItem is an item that can be identified by a string. Implements list.DefaultItem.
type ItemDelegate ¶
type ItemDelegate interface { list.ItemDelegate }
ItemDelegate is a wrapper around list.ItemDelegate.
type SelectMsg ¶
type SelectMsg struct{ IdentifiableItem }
SelectMsg is a message that is sent when an item is selected.
type Selector ¶
Selector is a list of items that can be selected.
func New ¶
func New(common common.Common, items []IdentifiableItem, delegate ItemDelegate) *Selector
New creates a new selector.
func (*Selector) DisableQuitKeybindings ¶
func (s *Selector) DisableQuitKeybindings()
DisableQuitKeybindings disables the quit keybindings.
func (*Selector) SelectItem ¶
SelectItem is a command that selects the currently active item.
func (*Selector) SetFilteringEnabled ¶
SetFilteringEnabled sets the filtering enabled flag.
func (*Selector) SetItems ¶
func (s *Selector) SetItems(items []IdentifiableItem) tea.Cmd
SetItems sets the items in the selector.
func (*Selector) SetShowFilter ¶
SetShowFilter sets the show filter flag.
func (*Selector) SetShowHelp ¶
SetShowHelp sets the show help flag.
func (*Selector) SetShowPagination ¶
SetShowPagination sets the show pagination flag.
func (*Selector) SetShowStatusBar ¶
SetShowStatusBar sets the show status bar flag.
func (*Selector) SetShowTitle ¶
SetShowTitle sets the show title flag.
func (*Selector) TotalPages ¶
TotalPages returns the total number of pages.