list

package
v1.40.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InlineList

type InlineList struct {
	Items             []ListItem
	MaxDisplayedItems int

	Paginator paginator.Model
	// contains filtered or unexported fields
}

func NewInlineList

func NewInlineList(args InlineListArgs) InlineList

func (InlineList) Choice

func (m InlineList) Choice() string

func (InlineList) CursorDown

func (m InlineList) CursorDown() InlineList

func (InlineList) CursorUp

func (m InlineList) CursorUp() InlineList

func (InlineList) Init

func (m InlineList) Init() tea.Cmd

func (*InlineList) SetChoice

func (m *InlineList) SetChoice(choice string)

func (InlineList) Update

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

func (InlineList) UpdateInlineList

func (m InlineList) UpdateInlineList(msg tea.Msg) (InlineList, tea.Cmd)

UpdateInlineList does the same thing as Update, without erasing the component's type.

useful when composing this model into another model

func (InlineList) UpdateItems

func (m InlineList) UpdateItems(items []ListItem) InlineList

func (InlineList) View

func (m InlineList) View() string

type InlineListArgs

type InlineListArgs struct {
	Items             []ListItem
	MaxDisplayedItems int
}

type ListItem

type ListItem interface {
	GetItemValue() string
	GetItemDescription() string
}

func StringsToListItems

func StringsToListItems(strings []string) []ListItem

type StringItem

type StringItem struct {
	Value string
}

func (StringItem) GetItemDescription

func (s StringItem) GetItemDescription() string

func (StringItem) GetItemValue

func (s StringItem) GetItemValue() string

type UpdateListItemsMsg

type UpdateListItemsMsg []ListItem

Jump to

Keyboard shortcuts

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