table

package
v4.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Title  string
	Hidden *bool
	Width  *int
	Grow   *bool
}

type Model

type Model struct {
	Columns    []Column
	Rows       []Row
	EmptyState *string
	// contains filtered or unexported fields
}

func NewModel

func NewModel(
	ctx context.ProgramContext,
	dimensions constants.Dimensions,
	lastUpdated time.Time,
	columns []Column,
	rows []Row,
	itemTypeLabel string,
	emptyState *string,
	loadingMessage string,
	isLoading bool,
) Model

func (*Model) FirstItem

func (m *Model) FirstItem() int

func (*Model) GetCurrItem

func (m *Model) GetCurrItem() int

func (*Model) LastItem

func (m *Model) LastItem() int

func (*Model) LastUpdated

func (m *Model) LastUpdated() time.Time

func (*Model) NextItem

func (m *Model) NextItem() int

func (*Model) OnLineDown

func (m *Model) OnLineDown()

func (*Model) OnLineUp

func (m *Model) OnLineUp()

func (*Model) PrevItem

func (m *Model) PrevItem() int

func (*Model) ResetCurrItem

func (m *Model) ResetCurrItem()

func (*Model) SetDimensions

func (m *Model) SetDimensions(dimensions constants.Dimensions)

func (*Model) SetIsLoading

func (m *Model) SetIsLoading(isLoading bool)

func (*Model) SetRows

func (m *Model) SetRows(rows []Row)

func (Model) StartLoadingSpinner

func (m Model) StartLoadingSpinner() tea.Cmd

func (*Model) SyncViewPortContent

func (m *Model) SyncViewPortContent()

func (Model) Update

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

func (*Model) UpdateLastUpdated

func (m *Model) UpdateLastUpdated(t time.Time)

func (*Model) UpdateProgramContext

func (m *Model) UpdateProgramContext(ctx *context.ProgramContext)

func (*Model) UpdateTotalItemsCount

func (m *Model) UpdateTotalItemsCount(count int)

func (Model) View

func (m Model) View() string

type Row

type Row []string

Jump to

Keyboard shortcuts

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