selector

package
v3.82.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

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

type Selector struct {
	list.Model
	// contains filtered or unexported fields
}

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) Index

func (s *Selector) Index() int

Index returns the index of the selected item.

func (*Selector) Init

func (s *Selector) Init() tea.Cmd

Init implements tea.Model.

func (*Selector) Page

func (s *Selector) Page() int

Page returns the current page.

func (*Selector) PerPage

func (s *Selector) PerPage() int

PerPage returns the number of items per page.

func (*Selector) Select

func (s *Selector) Select(index int)

Select selects the item at the given index.

func (*Selector) SelectItem

func (s *Selector) SelectItem() tea.Msg

SelectItem is a command that selects the currently active item.

func (*Selector) SetFilteringEnabled

func (s *Selector) SetFilteringEnabled(enabled bool)

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) SetPage

func (s *Selector) SetPage(page int)

SetPage sets the current page.

func (*Selector) SetShowFilter

func (s *Selector) SetShowFilter(show bool)

SetShowFilter sets the show filter flag.

func (*Selector) SetShowHelp

func (s *Selector) SetShowHelp(show bool)

SetShowHelp sets the show help flag.

func (*Selector) SetShowPagination

func (s *Selector) SetShowPagination(show bool)

SetShowPagination sets the show pagination flag.

func (*Selector) SetShowStatusBar

func (s *Selector) SetShowStatusBar(show bool)

SetShowStatusBar sets the show status bar flag.

func (*Selector) SetShowTitle

func (s *Selector) SetShowTitle(show bool)

SetShowTitle sets the show title flag.

func (*Selector) SetSize

func (s *Selector) SetSize(width, height int)

SetSize implements common.Component.

func (*Selector) TotalPages

func (s *Selector) TotalPages() int

TotalPages returns the total number of pages.

func (*Selector) Update

func (s *Selector) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Selector) View

func (s *Selector) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL