common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableHeightPadding = 10
	TableWidthPadding  = 5
)

Variables

View Source
var BaseTableStyle = lipgloss.NewStyle().
	BorderStyle(lipgloss.NormalBorder()).
	BorderForeground(main).
	Margin(1)
View Source
var TableCellStyle = lipgloss.NewStyle().
	Padding(0, 1)
View Source
var TableHeaderStyle = lipgloss.NewStyle().
	BorderStyle(lipgloss.NormalBorder()).
	BorderForeground(main).
	BorderBottom(true).
	Bold(true).
	Padding(0, 1)
View Source
var TableSelectedStyle = lipgloss.NewStyle().
	Foreground(lipgloss.Color("231")).
	Background(lipgloss.Color("033")).
	Bold(false)
View Source
var TableStyles = table.Styles{
	Selected: TableSelectedStyle,
	Header:   TableHeaderStyle,
	Cell:     TableCellStyle,
}

Functions

func CreateTable

func CreateTable(headers []string, dataRows []TableData) table.Model

CreateTable creates a table with dynamic column widths based on the provided headers and data. headers: Titles of the columns. dataRows: Data to be displayed, where each TableData represents a row.

func InsertDecimal

func InsertDecimal(str string, position int) string

func ToName added in v0.1.1

func ToName(principal string) string

func WriteRowsToCSV

func WriteRowsToCSV(rows []table.Row, fileName string) error

Types

type TableData

type TableData []string

TableData represents a single row of data to be displayed in the table.

Jump to

Keyboard shortcuts

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