listv

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleListItemDelegate

func NewSimpleListItemDelegate(itemStyle lipgloss.Style, selectedItemPrefix string, selectedItemStyle lipgloss.Style) list.ItemDelegate

Types

type ListItem

type ListItem interface {
	ID() string
	Title() string
	FilterValue() string
}

func NewSimpleListItem

func NewSimpleListItem(id, title, filterValue string) ListItem

type OnResponseFunc

type OnResponseFunc func(response *Response) tea.Cmd

type Response

type Response struct {
	Selection ListItem
	Error     error
	// contains filtered or unexported fields
}

func (*Response) OnResponse

func (r *Response) OnResponse(msg bubbleviews.ResponseMessage) tea.Cmd

func (*Response) View

func (r *Response) View() bubbleviews.View

type View

type View struct {
	List list.Model
	ext.PrefixExt
	ext.SuffixExt
	// contains filtered or unexported fields
}

func New

func New(items []ListItem, delegate list.ItemDelegate) *View

func (*View) Init

func (m *View) Init() tea.Cmd

func (*View) OnResponse

func (m *View) OnResponse() OnResponseFunc

func (*View) SetItems

func (m *View) SetItems(items []ListItem)

func (*View) SetOnResponse

func (m *View) SetOnResponse(fn OnResponseFunc)

func (*View) Update

func (m *View) Update(msg tea.Msg) tea.Cmd

func (*View) View

func (m *View) View() string

Jump to

Keyboard shortcuts

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