list

package
v0.0.0-...-d48bf00 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegateFunctions

type DelegateFunctions struct {
	ChooseFn func(string) tea.Cmd
	RemoveFn func(string) tea.Cmd
	EditFn   func(string) tea.Cmd
	AddFn    func(string) tea.Cmd
}

type Item

type Item struct {
	ItemId          string
	ItemTitle       string
	ItemDescription string
}

func (Item) Description

func (i Item) Description() string

func (Item) FilterValue

func (i Item) FilterValue() string

func (Item) Id

func (i Item) Id() string

func (Item) Title

func (i Item) Title() string

type Model

type Model struct {
	List         list.Model
	Keys         *listKeyMap
	DelegateKeys *delegateKeyMap
	DelegateFn   *DelegateFunctions
}

func NewFancyListModel

func NewFancyListModel(title string, items []Item, delegateFn *DelegateFunctions) *Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) Items

func (m *Model) Items() []Item

func (*Model) RemoveItemById

func (m *Model) RemoveItemById(id string) tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

func (*Model) WithAddFn

func (m *Model) WithAddFn(addFn func(string) tea.Cmd) *Model

func (*Model) WithChooseFn

func (m *Model) WithChooseFn(chooseFn func(string) tea.Cmd) *Model

func (*Model) WithEditFn

func (m *Model) WithEditFn(editFn func(string) tea.Cmd) *Model

func (*Model) WithRemoveFn

func (m *Model) WithRemoveFn(removeFn func(string) tea.Cmd) *Model

Jump to

Keyboard shortcuts

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