Documentation
¶
Overview ¶
Package components provides reusable TUI components
Index ¶
- type Footer
- type Header
- type HelpItem
- type ProgressBar
- type ProgressItem
- type ProgressList
- func (p *ProgressList) AddItem(name string, status ProgressStatus, detail string) *ProgressList
- func (p *ProgressList) ClearItems() *ProgressList
- func (p *ProgressList) Counters() map[ProgressStatus]int
- func (p *ProgressList) SetDimensions(width, height int) *ProgressList
- func (p *ProgressList) SetTitle(title string) *ProgressList
- func (p *ProgressList) Summary() string
- func (p *ProgressList) UpdateItem(index int, status ProgressStatus, detail string) *ProgressList
- func (p *ProgressList) View() string
- type ProgressStatus
- type SimpleFooter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Footer ¶
type Footer struct {
// contains filtered or unexported fields
}
Footer represents the app footer component with help
func (*Footer) SetBindings ¶
SetBindings sets the help key bindings
func (*Footer) SetShowQuit ¶
SetShowQuit sets whether to show quit help
type Header ¶
type Header struct {
Title string
Subtitle string
IsAuthenticated bool
Username string
Width int
// contains filtered or unexported fields
}
Header represents the app header component
func (*Header) SetSubtitle ¶
SetSubtitle sets the header subtitle
type ProgressBar ¶
type ProgressBar struct {
Label string
Current int
Total int
Width int
ShowPct bool
// contains filtered or unexported fields
}
ProgressBar represents a progress bar component
func (*ProgressBar) SetLabel ¶
func (p *ProgressBar) SetLabel(label string) *ProgressBar
SetLabel sets the progress label
func (*ProgressBar) SetProgress ¶
func (p *ProgressBar) SetProgress(current, total int) *ProgressBar
SetProgress sets the current progress
func (*ProgressBar) SetShowPct ¶
func (p *ProgressBar) SetShowPct(show bool) *ProgressBar
SetShowPct sets whether to show percentage
func (*ProgressBar) SetWidth ¶
func (p *ProgressBar) SetWidth(width int) *ProgressBar
SetWidth sets the progress bar width
type ProgressItem ¶
type ProgressItem struct {
Name string
Status ProgressStatus
Detail string
}
ProgressItem represents a single progress item in a list
type ProgressList ¶
type ProgressList struct {
Title string
Items []ProgressItem
Width int
Height int
// contains filtered or unexported fields
}
ProgressList represents a list of progress items
func NewProgressList ¶
func NewProgressList() *ProgressList
NewProgressList creates a new progress list
func (*ProgressList) AddItem ¶
func (p *ProgressList) AddItem(name string, status ProgressStatus, detail string) *ProgressList
AddItem adds an item to the list
func (*ProgressList) ClearItems ¶
func (p *ProgressList) ClearItems() *ProgressList
ClearItems clears all items
func (*ProgressList) Counters ¶
func (p *ProgressList) Counters() map[ProgressStatus]int
Counters returns the count of items by status
func (*ProgressList) SetDimensions ¶
func (p *ProgressList) SetDimensions(width, height int) *ProgressList
SetDimensions sets the list dimensions
func (*ProgressList) SetTitle ¶
func (p *ProgressList) SetTitle(title string) *ProgressList
SetTitle sets the list title
func (*ProgressList) Summary ¶
func (p *ProgressList) Summary() string
Summary returns a summary string
func (*ProgressList) UpdateItem ¶
func (p *ProgressList) UpdateItem(index int, status ProgressStatus, detail string) *ProgressList
UpdateItem updates an existing item
type ProgressStatus ¶
type ProgressStatus int
ProgressStatus represents the status of a progress item
const ( StatusPending ProgressStatus = iota StatusInProgress StatusSuccess StatusWarning StatusError StatusSkipped )
type SimpleFooter ¶
type SimpleFooter struct {
// contains filtered or unexported fields
}
SimpleFooter creates a footer from simple key/value pairs
func NewSimpleFooter ¶
func NewSimpleFooter() *SimpleFooter
NewSimpleFooter creates a new simple footer
func (*SimpleFooter) AddItem ¶
func (f *SimpleFooter) AddItem(key, value string) *SimpleFooter
AddItem adds a help item
func (*SimpleFooter) SetShowQuit ¶
func (f *SimpleFooter) SetShowQuit(show bool) *SimpleFooter
SetShowQuit sets whether to show quit help
func (*SimpleFooter) SetWidth ¶
func (f *SimpleFooter) SetWidth(width int) *SimpleFooter
SetWidth sets the footer width