Documentation ¶
Index ¶
- type ActiveMsg
- type IdentifiableItem
- type ItemDelegate
- type SelectMsg
- type Selector
- func (s *Selector) CursorDown()
- func (s *Selector) CursorUp()
- func (s *Selector) DisableQuitKeybindings()
- func (s *Selector) FilterState() list.FilterState
- func (s *Selector) Index() int
- func (s *Selector) Init() tea.Cmd
- func (s *Selector) Items() []list.Item
- func (s *Selector) Page() int
- func (s *Selector) PerPage() int
- func (s *Selector) Select(index int)
- func (s *Selector) SelectItemCmd() tea.Msg
- func (s *Selector) SelectedItem() IdentifiableItem
- 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) SetTotalPages(items int) int
- func (s *Selector) TotalPages() int
- func (s *Selector) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (s *Selector) View() string
- func (s *Selector) VisibleItems() []list.Item
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) FilterState ¶
func (s *Selector) FilterState() list.FilterState
FilterState returns the filter state.
func (*Selector) SelectItemCmd ¶
SelectItemCmd is a command that selects the currently active item.
func (*Selector) SelectedItem ¶
func (s *Selector) SelectedItem() IdentifiableItem
SelectedItem returns the currently selected 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) SetTotalPages ¶
SetTotalPages sets the total number of pages given the number of items.
func (*Selector) TotalPages ¶
TotalPages returns the total number of pages.
func (*Selector) VisibleItems ¶
VisibleItems returns all the visible items in the selector.