view

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LastUpdateCellWidth = lipgloss.Width(" Updated")
	ContainerPadding    = 1

	ColumnTitle = lipgloss.NewStyle().Bold(true)
	LabelTitle  = lipgloss.NewStyle().Width(3)
)

Functions

This section is empty.

Types

type Model

type Model struct {
	Id        int
	Ctx       *context.ProgramContext
	Spinner   spinner.Model
	IsLoading bool
	Table     table.Model
	Type      string
}

func (*Model) CreateNextTickCmd

func (m *Model) CreateNextTickCmd(nextTickCmd tea.Cmd) tea.Cmd

func (*Model) FirstItem

func (m *Model) FirstItem() int

func (*Model) GetDimensions

func (m *Model) GetDimensions() constants.Dimensions

func (*Model) GetIsLoading

func (m *Model) GetIsLoading() bool

func (*Model) LastItem

func (m *Model) LastItem() int

func (*Model) NextRow

func (m *Model) NextRow() int

func (*Model) PrevRow

func (m *Model) PrevRow() int

func (*Model) UpdateProgramContext

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

type View

type View interface {
	Id() int
	Update(msg tea.Msg) (View, tea.Cmd)
	View() string
	NumRows() int
	GetCurrRow() data.RowData
	NextRow() int
	PrevRow() int
	FirstItem() int
	LastItem() int
	FetchViewRows() tea.Cmd
	GetIsLoading() bool
	GetViewColumns() []table.Column
	BuildRows() []table.Row
	UpdateProgramContext(ctx *context.ProgramContext)
}

type ViewMsg

type ViewMsg interface {
	GetViewId() int
	GetViewType() string
}

type ViewRowsFetchedMsg

type ViewRowsFetchedMsg struct {
	ViewId int
}

func (ViewRowsFetchedMsg) GetViewId

func (msg ViewRowsFetchedMsg) GetViewId() int

type ViewTickMsg

type ViewTickMsg struct {
	ViewId          int
	InternalTickMsg tea.Msg
	Type            string
}

func (ViewTickMsg) GetViewId

func (msg ViewTickMsg) GetViewId() int

func (ViewTickMsg) GetViewType

func (msg ViewTickMsg) GetViewType() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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