split

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys = keyMap{
	ToggleSplit: key.NewBinding(
		key.WithKeys("S"),
		key.WithHelp("S", "toggle split"),
	),
	DecreaseSplit: key.NewBinding(
		key.WithKeys("-"),
		key.WithHelp("-", "decrease split"),
	),
	IncreaseSplit: key.NewBinding(
		key.WithKeys("+"),
		key.WithHelp("+", "increase split"),
	),
	SwitchPane: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "switch pane"),
	),
}

Functions

This section is empty.

Types

type Model

type Model[R resource.Resource] struct {
	Table table.Model[R]
	// contains filtered or unexported fields
}

Model is a composition of two models corresponding to two panes: a top pane is a list of resources; the bottom pane provides further details of the resource corresponding to the current row in the list - this pane is known as the 'preview'.

func New

func New[R resource.Resource](opts Options[R]) Model[R]

func (Model[R]) Init

func (m Model[R]) Init() tea.Cmd

func (Model[R]) Update

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

func (Model[R]) View

func (m Model[R]) View() string

type Options

type Options[R resource.Resource] struct {
	Columns      []table.Column
	Renderer     table.RowRenderer[R]
	TableOptions []table.Option[R]
	Width        int
	Height       int
	Maker        tui.Maker
}

type Preview

type Preview interface {
	tea.Model

	SetBorderStyle(lipgloss.Style)
}

Jump to

Keyboard shortcuts

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