selection

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 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 NewItem

func NewItem(c common.Common, repo proto.Repository) (Item, error)

New creates a new Item.

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 NewItemDelegate

func NewItemDelegate(common *common.Common, activePane *pane) *ItemDelegate

NewItemDelegate creates a new ItemDelegate.

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 Items

type Items []Item

Items is a list of Item.

func (Items) Len

func (it Items) Len() int

Len implements sort.Interface.

func (Items) Less

func (it Items) Less(i int, j int) bool

Less implements sort.Interface.

func (Items) Swap

func (it Items) Swap(i int, j int)

Swap implements sort.Interface.

type Selection

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

Selection is the model for the selection screen/page.

func New

func New(c common.Common) *Selection

New creates a new selection model.

func (*Selection) FilterState

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

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