ui

package module
v0.0.0-...-860c0ef Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Selected = lipgloss.NewStyle().Background(lipgloss.Color("#404040"))
)
View Source
var (
	White = lipgloss.Color("#FFFFFF")
)

Functions

func AnsiCol

func AnsiCol(content string, width int) string

func AnsiTrim

func AnsiTrim(content string, width int) string

func AsCommand

func AsCommand(msg tea.Msg) tea.Cmd

func DefaultDefocus

func DefaultDefocus(s lipgloss.Style) lipgloss.Style

func DefaultFocus

func DefaultFocus(s lipgloss.Style) lipgloss.Style

func NewFooter

func NewFooter(model tea.Model, footer string) tea.Model

func NewKillable

func NewKillable(delegate tea.Model) tea.Model

func Resolve

func Resolve(req []SizeDefinition, max int) []int

func WithBorder

func WithBorder(m tea.Model) tea.Model

Types

type ActivateTabMsg

type ActivateTabMsg struct {
	Name string
	Msg  tea.Msg
}

type Bordered

type Bordered struct {
	tea.Model
	// contains filtered or unexported fields
}

func (*Bordered) Update

func (b *Bordered) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Bordered) View

func (b *Bordered) View() string

type Detail

type Detail[T any] struct {
	*Text
	// contains filtered or unexported fields
}

func NewDetail

func NewDetail[T any](render func(T) string) *Detail[T]

func (*Detail[T]) ChangeStyle

func (t *Detail[T]) ChangeStyle(f func(orig lipgloss.Style) lipgloss.Style)

func (*Detail[T]) Update

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

type FilterableList

type FilterableList[T any] struct {
	*List[T]
	// contains filtered or unexported fields
}

func NewFilterableList

func NewFilterableList[T any](content []T, render func(T) string, filter func(string, T) bool, opts ...FilterableListOpts[T]) *FilterableList[T]

func (*FilterableList[T]) Init

func (t *FilterableList[T]) Init() tea.Cmd

func (*FilterableList[T]) Update

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

func (*FilterableList[T]) View

func (f *FilterableList[T]) View() string

type FilterableListOpts

type FilterableListOpts[T any] func(*FilterableList[T])

func FilterableListInitialFilter

func FilterableListInitialFilter[T any](s string) FilterableListOpts[T]

type FocusGroup

type FocusGroup struct {
	Items   []tea.Model
	Focused int
	tea.Model
}

func NewFocusGroup

func NewFocusGroup(child tea.Model) *FocusGroup

func (*FocusGroup) Add

func (f *FocusGroup) Add(m tea.Model)

func (*FocusGroup) Init

func (f *FocusGroup) Init() tea.Cmd

func (*FocusGroup) Update

func (f *FocusGroup) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*FocusGroup) View

func (f *FocusGroup) View() string

type FocusMsg

type FocusMsg struct {
	Change  func(lipgloss.Style) lipgloss.Style
	Focused bool
}

type FocusedItemMsg

type FocusedItemMsg[T any] struct {
	Item T
}

type GrabInput

type GrabInput struct {
}

type Horizontal

type Horizontal struct {
	Size     tea.WindowSizeMsg
	Children Panels
}

func (*Horizontal) Add

func (v *Horizontal) Add(model tea.Model, size SizeDefinition)

func (*Horizontal) Init

func (v *Horizontal) Init() tea.Cmd

func (*Horizontal) Update

func (v *Horizontal) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Horizontal) View

func (v *Horizontal) View() string

type Killable

type Killable struct {
	tea.Model
	// contains filtered or unexported fields
}

func (*Killable) Update

func (k *Killable) Update(msg tea.Msg) (tea.Model, tea.Cmd)

type List

type List[T any] struct {
	Render        func(T) string
	SelectedStyle lipgloss.Style
	Focused       bool
	// contains filtered or unexported fields
}

func NewList

func NewList[T any](content []T, render func(T) string) *List[T]

func (*List[T]) ChangeStyle

func (t *List[T]) ChangeStyle(f func(orig lipgloss.Style) lipgloss.Style)

func (*List[T]) Empty

func (t *List[T]) Empty() bool

func (*List[T]) Init

func (t *List[T]) Init() tea.Cmd

func (*List[T]) Reset

func (t *List[T]) Reset()

func (*List[T]) Select

func (t *List[T]) Select(ix int)

func (*List[T]) Selected

func (t *List[T]) Selected() T

func (*List[T]) SetContent

func (t *List[T]) SetContent(n []T)

func (*List[T]) Update

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

func (*List[T]) View

func (t *List[T]) View() string

type OverridableInput

type OverridableInput struct {
	// contains filtered or unexported fields
}

type Panel

type Panel struct {
	tea.Model
	Size SizeDefinition
}

type Panels

type Panels []*Panel

type RefreshMsg

type RefreshMsg struct {
}

type ReleaseInput

type ReleaseInput struct {
}

type Scrolled

type Scrolled struct {
	Content func() string
	Width   int
	Height  int
	Lines   []string
	Start   int
	Style   lipgloss.Style
	Focused bool
}

func NewScrolled

func NewScrolled(content func() string) *Scrolled

func (*Scrolled) Init

func (t *Scrolled) Init() tea.Cmd

func (*Scrolled) ResetPosition

func (t *Scrolled) ResetPosition()

func (*Scrolled) ScrollToEnd

func (t *Scrolled) ScrollToEnd()

func (*Scrolled) Update

func (t *Scrolled) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Scrolled) View

func (t *Scrolled) View() string

type Size

type Size struct {
	Width  int
	Height int
}

func NewSizeFromSizeMsg

func NewSizeFromSizeMsg(msg tea.WindowSizeMsg) Size

type SizeDefinition

type SizeDefinition interface {
}

func FixedSize

func FixedSize(v int) SizeDefinition

func RatioSize

func RatioSize(d int) SizeDefinition

func RemainingSize

func RemainingSize() SizeDefinition

type Tab

type Tab struct {
	Name  string
	Model tea.Model
	Key   string
}

type Tabs

type Tabs struct {
	// contains filtered or unexported fields
}

func NewTabs

func NewTabs(tabs ...Tab) *Tabs

func (*Tabs) Add

func (t *Tabs) Add(s string, details tea.Model, key string) *Tab

func (*Tabs) Init

func (t *Tabs) Init() tea.Cmd

func (*Tabs) Update

func (t *Tabs) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Tabs) UpdateAll

func (t *Tabs) UpdateAll(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Tabs) View

func (t *Tabs) View() string

type Text

type Text struct {
	Content func() string

	Style   lipgloss.Style
	Focused bool
	// contains filtered or unexported fields
}

func NewText

func NewText(content func() string) *Text

func (*Text) GetHeight

func (t *Text) GetHeight() int

func (*Text) Init

func (t *Text) Init() tea.Cmd

func (*Text) Update

func (t *Text) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Text) View

func (t *Text) View() string

type TreeList

type TreeList[L, T any] struct {
	*List[T]
	// contains filtered or unexported fields
}

func NewTreeList

func NewTreeList[L, T any](content L, render func(T) string, items func(L) []T, down func(T) (L, bool)) *TreeList[L, T]

func (*TreeList[L, T]) CurrentLevel

func (t *TreeList[L, T]) CurrentLevel() L

func (*TreeList[L, T]) NavigateTo

func (t *TreeList[L, T]) NavigateTo(f func(check T) bool)

func (*TreeList[L, T]) Selected

func (t *TreeList[L, T]) Selected() T

func (*TreeList[L, T]) Update

func (t *TreeList[L, T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)

type Vertical

type Vertical struct {
	Size     tea.WindowSizeMsg
	Children Panels
}

func NewHeader

func NewHeader(header string, model tea.Model) *Vertical

func (*Vertical) Add

func (v *Vertical) Add(model tea.Model, size SizeDefinition)

func (*Vertical) Init

func (v *Vertical) Init() tea.Cmd

func (*Vertical) Update

func (v *Vertical) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Vertical) View

func (v *Vertical) View() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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