selection

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	// contains filtered or unexported fields
}

Item represents a single item in the selector.

func (Item) Command

func (i Item) Command() string

Command returns the item Command view.

func (Item) Description

func (i Item) Description() string

Description returns the item description. Implements list.DefaultItem.

func (Item) FilterValue

func (i Item) FilterValue() string

FilterValue implements list.Item.

func (Item) ID

func (i Item) ID() string

ID implements selector.IdentifiableItem.

func (Item) Title

func (i Item) Title() string

Title returns the item title. Implements list.DefaultItem.

type ItemDelegate

type ItemDelegate struct {
	// contains filtered or unexported fields
}

ItemDelegate is the delegate for the item.

func (ItemDelegate) Height

func (d ItemDelegate) Height() int

Height returns the item height. Implements list.ItemDelegate.

func (ItemDelegate) Render

func (d ItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render implements list.ItemDelegate.

func (ItemDelegate) Spacing

func (d ItemDelegate) Spacing() int

Spacing returns the spacing between items. Implements list.ItemDelegate.

func (ItemDelegate) Update

func (d ItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update implements list.ItemDelegate.

func (ItemDelegate) Width

func (d ItemDelegate) Width() int

Width returns the item width.

type Selection

type Selection struct {
	// contains filtered or unexported fields
}

Selection is the model for the selection screen/page.

func New

func New(cfg *config.Config, pk ssh.PublicKey, common common.Common) *Selection

New creates a new selection model.

func (*Selection) FilterState added in v0.4.2

func (s *Selection) FilterState() list.FilterState

FilterState returns the current filter state.

func (*Selection) FullHelp

func (s *Selection) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Selection) Init

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

Init implements tea.Model.

func (*Selection) IsFiltering added in v0.4.2

func (s *Selection) IsFiltering() bool

IsFiltering returns true if the selector is currently filtering.

func (*Selection) SetSize

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

SetSize implements common.Component.

func (*Selection) ShortHelp

func (s *Selection) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Selection) Update

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

Update implements tea.Model.

func (*Selection) View

func (s *Selection) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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