list

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HumanizeTime

func HumanizeTime(s int) string

Types

type Item

type Item interface {
	Text() string
	Group() string
	Length() int

	Id() int
}

type Model

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

func New

func New(items []Item, width, height int, title string, isActive bool, id string) Model

func (*Model) AddItems

func (m *Model) AddItems(items []Item)

func (*Model) GetActiveItem

func (m *Model) GetActiveItem() int

func (Model) GetCursorItem

func (m Model) GetCursorItem() (Item, int)

func (Model) GetDuration

func (m Model) GetDuration() int

func (Model) GetHeight

func (m Model) GetHeight() int

func (Model) GetId

func (m Model) GetId() string

func (Model) GetItems

func (m Model) GetItems() []Item

func (Model) GetLastItem

func (m Model) GetLastItem() (Item, int)

func (Model) GetTextHeight

func (m Model) GetTextHeight() int

func (Model) GetTextWidth

func (m Model) GetTextWidth() int

func (*Model) GetTitle

func (m *Model) GetTitle() string

func (*Model) HandleKeys

func (m *Model) HandleKeys(msg tea.KeyMsg) tea.Cmd

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Len

func (m Model) Len() int

func (Model) RenderBox

func (m Model) RenderBox(title, content string, borderStyle lipgloss.Style) string

func (Model) RenderLine

func (m Model) RenderLine(line string, style lipgloss.Style) string

func (*Model) Search

func (m *Model) Search(searchTerm string)

func (*Model) SearchExact

func (m *Model) SearchExact(searchTerm string) bool

func (*Model) SetActiveItem

func (m *Model) SetActiveItem(pos int)

func (*Model) SetCursor

func (m *Model) SetCursor(c int)

func (*Model) SetCursorDown

func (m *Model) SetCursorDown()

func (*Model) SetCursorToNextMatch

func (m *Model) SetCursorToNextMatch(searchTerm string)

func (*Model) SetCursorUp

func (m *Model) SetCursorUp()

func (*Model) SetIsActive

func (m *Model) SetIsActive(isActive bool)

func (*Model) SetItems

func (m *Model) SetItems(items []Item, cursorPos int, id string)

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

func (Model) Update

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

func (*Model) UpdateViewPort

func (m *Model) UpdateViewPort()

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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