table

package
v0.0.0-...-953c692 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YELLOW = "\033[33m"
	RED    = "\033[31m"
	ITALIC = "\033[3m"
	DIM    = "\033[2m"
	RESET  = "\033[0m"
)
View Source
const (
	Gray               = "240"
	White              = "15"
	Green              = "2"
	Orange             = "214"
	Red                = "9"
	BorderColor        = Gray
	SelectedForeground = White
	SelectedBackground = "#006ab3" // SNCB blue

)

Variables

View Source
var DetailsBoxStyle = lipgloss.NewStyle().Padding(1)

Functions

func CalculateHumanRelativeTime

func CalculateHumanRelativeTime(t timeable) string

func LeftPad

func LeftPad(s string, padWidth int) string

func RenderTable

func RenderTable[T Data](
	columnItems []table.Column,
	rowItems []table.Row,
	data []T,
)

func RightPad

func RightPad(s string, padWidth int) string

Types

type Data

type Data interface {
	api.Connection | api.TimetableDeparture | api.Issue
}

type Model

type Model[T Data] struct {
	// contains filtered or unexported fields
}

func (*Model[T]) Init

func (m *Model[T]) Init() tea.Cmd

func (*Model[T]) Update

func (m *Model[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model[T]) View

func (m *Model[T]) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳