Help us shape the future of Go! Take the 2026 Go Developer Survey

list

package
v0.0.0-...-63b292e Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 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 List

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

func New

func New(theme colors.Theme, doubleClickDelay int) List

func (*List) Blur

func (m *List) Blur()

Blur blurs the table, preventing selection or movement.

func (*List) CursorName

func (list *List) CursorName() string

func (*List) EntryNames

func (list *List) EntryNames() []string

EntryNames returns a slice of the names of the entries in the list

func (*List) Focus

func (m *List) Focus()

Focus focuses the table, allowing the user to move around the rows and interact.

func (*List) Focused

func (m *List) Focused() bool

Focused returns the focus state of the table.

func (*List) Init

func (list *List) Init() tea.Cmd

func (*List) IsEmpty

func (list *List) IsEmpty() bool

func (*List) SelectedEntries

func (list *List) SelectedEntries() map[string]struct{}

TODO: Change this when reimplementing the list

func (*List) SelectedEntry

func (list *List) SelectedEntry() entry.Entry

THIS CAN CAUSE A PANIC IF THE LIST IS EMPTY The zero value of an entry is has a nil pointer for fs.FileInfo

func (*List) SelectedEntryName

func (list *List) SelectedEntryName() string

func (*List) SetHeight

func (list *List) SetHeight(height int)

func (*List) SetWidth

func (list *List) SetWidth(width int)

func (*List) Update

func (list *List) Update(msg tea.Msg) (List, tea.Cmd)

func (*List) View

func (list *List) View() string

type Table

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

Table defines a state for the table widget.

func NewTable

func NewTable() Table

NewTable creates a new model for the table widget.

func (*Table) ClearSelected

func (m *Table) ClearSelected()

ClearSelected unselects all rows

func (Table) Cursor

func (m Table) Cursor() int

Cursor returns the index of the selected row.

func (*Table) GoToBottom

func (m *Table) GoToBottom()

GoToBottom moves the cursor to the last row.

func (*Table) GoToTop

func (m *Table) GoToTop()

GoToTop moves the cursor to the first row.

func (Table) Height

func (m Table) Height() int

Height returns the viewport height of the table.

func (*Table) MoveDown

func (m *Table) MoveDown(n int, multi bool)

MoveDown moves the selection down by any number of rows. It can not go below the last row.

func (*Table) MoveUp

func (m *Table) MoveUp(n int, multi bool)

MoveUp moves the selection up by any number of rows. It can not go above the first row.

func (*Table) MultiSelectToBottom

func (m *Table) MultiSelectToBottom()

MultiSelectToBottom selects all rows from the cursor to the bottom. And sets the cursor to the final row.

func (*Table) MultiSelectToTop

func (m *Table) MultiSelectToTop()

MultiSelectToTop selects all rows from the cursor to the top. And sets the cursor to the first row.

func (Table) NRows

func (m Table) NRows() int

NRows returns the current number of rows.

func (Table) SelectedRows

func (m Table) SelectedRows() []int

SelectedRows returns the indexes of the selected rows.

func (*Table) SetCursor

func (m *Table) SetCursor(n int)

SetCursor sets the cursor position in the table. If you only want one item selected, call ClearSelected before this method.

func (*Table) SetHeight

func (m *Table) SetHeight(h int)

SetHeight sets the number of rows that will be displayed.

func (*Table) SetNRows

func (m *Table) SetNRows(n int)

SetNRows sets the number of rows that the table has

func (*Table) SetSelected

func (m *Table) SetSelected(idxs []int) error

SetSelected sets the rows at the given indexes as selected.

Jump to

Keyboard shortcuts

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