Documentation
¶
Index ¶
- func BrightenColor(color lipgloss.Color, percent float64) lipgloss.Color
- func CalcWidthHeight(w, h int) (int, int)
- func ComponentId(comp *config.Component) string
- func GetBorderStyle(borderStyles *config.BorderStyleConfig) (normal lipgloss.Style, focused lipgloss.Style, border lipgloss.Border)
- func GetColor(configColor string, defaultColor lipgloss.Color) lipgloss.Color
- func GetFlex(flex int) int
- func HexToAnsi256(hex string, fallback byte) byte
- func PaletteColor(styles *config.StyleConfig, role string, fallback lipgloss.Color) lipgloss.Color
- func PaletteHex(styles *config.StyleConfig, role, fallback string) string
- func WrapContent(content string, width int) string
- type ChartComponent
- func (b ChartComponent) ActionActive() bool
- func (b ChartComponent) ActionLoading() bool
- func (c *ChartComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *ChartComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b ChartComponent) Bindings() []config.Binding
- func (b ChartComponent) Config() *config.Component
- func (b ChartComponent) GetAddInput() string
- func (c *ChartComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b ChartComponent) ID() string
- func (b ChartComponent) Init() tea.Cmd
- func (b ChartComponent) IsFocusable() bool
- func (c *ChartComponent) ResetAction() (Component, tea.Cmd)
- func (c *ChartComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (b ChartComponent) SupportsAdd() bool
- func (b ChartComponent) SupportsRefresh() bool
- func (b ChartComponent) Type() string
- func (c *ChartComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *ChartComponent) View(w, h int, focused bool) string
- type Component
- type HistogramComponent
- func (b HistogramComponent) ActionActive() bool
- func (b HistogramComponent) ActionLoading() bool
- func (c *HistogramComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *HistogramComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b HistogramComponent) Bindings() []config.Binding
- func (b HistogramComponent) Config() *config.Component
- func (b HistogramComponent) GetAddInput() string
- func (c *HistogramComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b HistogramComponent) ID() string
- func (b HistogramComponent) Init() tea.Cmd
- func (b HistogramComponent) IsFocusable() bool
- func (c *HistogramComponent) ResetAction() (Component, tea.Cmd)
- func (c *HistogramComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (b HistogramComponent) SupportsAdd() bool
- func (b HistogramComponent) SupportsRefresh() bool
- func (b HistogramComponent) Type() string
- func (c *HistogramComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *HistogramComponent) View(w, h int, focused bool) string
- type ListComponent
- func (b ListComponent) ActionActive() bool
- func (b ListComponent) ActionLoading() bool
- func (c *ListComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *ListComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b ListComponent) Bindings() []config.Binding
- func (b ListComponent) Config() *config.Component
- func (b ListComponent) GetAddInput() string
- func (c *ListComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b ListComponent) ID() string
- func (b ListComponent) Init() tea.Cmd
- func (b ListComponent) IsFocusable() bool
- func (c *ListComponent) ResetAction() (Component, tea.Cmd)
- func (c *ListComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (b ListComponent) SupportsAdd() bool
- func (b ListComponent) SupportsRefresh() bool
- func (b ListComponent) Type() string
- func (c *ListComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *ListComponent) View(w, h int, focused bool) string
- type ListItem
- type TableComponent
- func (b TableComponent) ActionActive() bool
- func (b TableComponent) ActionLoading() bool
- func (c *TableComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *TableComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b TableComponent) Bindings() []config.Binding
- func (b TableComponent) Config() *config.Component
- func (b TableComponent) GetAddInput() string
- func (c *TableComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b TableComponent) ID() string
- func (b TableComponent) Init() tea.Cmd
- func (b TableComponent) IsFocusable() bool
- func (c *TableComponent) ResetAction() (Component, tea.Cmd)
- func (c *TableComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (b TableComponent) SupportsAdd() bool
- func (b TableComponent) SupportsRefresh() bool
- func (b TableComponent) Type() string
- func (c *TableComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *TableComponent) View(w, h int, focused bool) string
- type TextComponent
- func (b TextComponent) ActionActive() bool
- func (b TextComponent) ActionLoading() bool
- func (c *TextComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *TextComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b TextComponent) Bindings() []config.Binding
- func (b TextComponent) Config() *config.Component
- func (b TextComponent) GetAddInput() string
- func (c *TextComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b TextComponent) ID() string
- func (b TextComponent) Init() tea.Cmd
- func (b TextComponent) IsFocusable() bool
- func (c *TextComponent) ResetAction() (Component, tea.Cmd)
- func (c *TextComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (b TextComponent) SupportsAdd() bool
- func (b TextComponent) SupportsRefresh() bool
- func (b TextComponent) Type() string
- func (c *TextComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *TextComponent) View(w, h int, focused bool) string
- type TodoComponent
- func (b TodoComponent) ActionActive() bool
- func (b TodoComponent) ActionLoading() bool
- func (c *TodoComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
- func (c *TodoComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
- func (b TodoComponent) Bindings() []config.Binding
- func (b TodoComponent) Config() *config.Component
- func (c *TodoComponent) GetAddInput() string
- func (c *TodoComponent) HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
- func (b TodoComponent) ID() string
- func (b TodoComponent) Init() tea.Cmd
- func (b TodoComponent) IsFocusable() bool
- func (c *TodoComponent) ResetAction() (Component, tea.Cmd)
- func (c *TodoComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
- func (c *TodoComponent) SupportsAdd() bool
- func (b TodoComponent) SupportsRefresh() bool
- func (b TodoComponent) Type() string
- func (c *TodoComponent) Update(msg tea.Msg) (Component, tea.Cmd)
- func (c *TodoComponent) View(w, h int, focused bool) string
- type TodoFetchOutput
- type TodoListItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcWidthHeight ¶
func ComponentId ¶
func GetBorderStyle ¶
func HexToAnsi256 ¶ added in v1.1.0
HexToAnsi256 maps a hex color string to the closest ANSI-256 palette index (0-255), suitable for libraries like asciigraph that don't accept truecolor. Returns the supplied fallback when parsing fails.
func PaletteColor ¶ added in v1.1.0
PaletteColor returns the lipgloss.Color for a named role, falling back to `fallback` when the role is unset or the active style has no palette.
func PaletteHex ¶ added in v1.1.0
func PaletteHex(styles *config.StyleConfig, role, fallback string) string
PaletteHex returns the raw hex string for a named role, or fallback if unset.
func WrapContent ¶
Types ¶
type ChartComponent ¶
type ChartComponent struct {
// contains filtered or unexported fields
}
func (ChartComponent) ActionActive ¶ added in v1.1.0
func (b ChartComponent) ActionActive() bool
func (ChartComponent) ActionLoading ¶ added in v1.1.0
func (b ChartComponent) ActionLoading() bool
func (*ChartComponent) ApplyActionResult ¶ added in v1.1.0
func (c *ChartComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*ChartComponent) BeginAction ¶ added in v1.1.0
func (c *ChartComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (ChartComponent) GetAddInput ¶
func (b ChartComponent) GetAddInput() string
func (*ChartComponent) HandleAddMode ¶
func (ChartComponent) IsFocusable ¶
func (b ChartComponent) IsFocusable() bool
func (*ChartComponent) ResetAction ¶ added in v1.1.0
func (c *ChartComponent) ResetAction() (Component, tea.Cmd)
func (*ChartComponent) SetContent ¶
func (c *ChartComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (ChartComponent) SupportsAdd ¶
func (b ChartComponent) SupportsAdd() bool
func (ChartComponent) SupportsRefresh ¶
func (b ChartComponent) SupportsRefresh() bool
type Component ¶
type Component interface {
ID() string
Type() string
IsFocusable() bool
SupportsAdd() bool
GetAddInput() string
SupportsRefresh() bool
Config() *config.Component
Bindings() []config.Binding
ActionActive() bool
ActionLoading() bool
BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
ResetAction() (Component, tea.Cmd)
Init() tea.Cmd
View(w, h int, focused bool) string
Update(msg tea.Msg) (Component, tea.Cmd)
SetContent(result data.FetchOutput) (Component, tea.Cmd)
HandleAddMode(msg tea.KeyMsg) (Component, bool, tea.Cmd)
}
func NewComponent ¶
func NewComponent(cfg *config.Component, styles *config.StyleConfig) Component
type HistogramComponent ¶
type HistogramComponent struct {
// contains filtered or unexported fields
}
func (HistogramComponent) ActionActive ¶ added in v1.1.0
func (b HistogramComponent) ActionActive() bool
func (HistogramComponent) ActionLoading ¶ added in v1.1.0
func (b HistogramComponent) ActionLoading() bool
func (*HistogramComponent) ApplyActionResult ¶ added in v1.1.0
func (c *HistogramComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*HistogramComponent) BeginAction ¶ added in v1.1.0
func (c *HistogramComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (HistogramComponent) GetAddInput ¶
func (b HistogramComponent) GetAddInput() string
func (*HistogramComponent) HandleAddMode ¶
func (HistogramComponent) IsFocusable ¶
func (b HistogramComponent) IsFocusable() bool
func (*HistogramComponent) ResetAction ¶ added in v1.1.0
func (c *HistogramComponent) ResetAction() (Component, tea.Cmd)
func (*HistogramComponent) SetContent ¶
func (c *HistogramComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (HistogramComponent) SupportsAdd ¶
func (b HistogramComponent) SupportsAdd() bool
func (HistogramComponent) SupportsRefresh ¶
func (b HistogramComponent) SupportsRefresh() bool
type ListComponent ¶
type ListComponent struct {
// contains filtered or unexported fields
}
func (ListComponent) ActionActive ¶ added in v1.1.0
func (b ListComponent) ActionActive() bool
func (ListComponent) ActionLoading ¶ added in v1.1.0
func (b ListComponent) ActionLoading() bool
func (*ListComponent) ApplyActionResult ¶ added in v1.1.0
func (c *ListComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*ListComponent) BeginAction ¶ added in v1.1.0
func (c *ListComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (ListComponent) GetAddInput ¶
func (b ListComponent) GetAddInput() string
func (*ListComponent) HandleAddMode ¶
func (ListComponent) IsFocusable ¶
func (b ListComponent) IsFocusable() bool
func (*ListComponent) ResetAction ¶ added in v1.1.0
func (c *ListComponent) ResetAction() (Component, tea.Cmd)
func (*ListComponent) SetContent ¶
func (c *ListComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (ListComponent) SupportsAdd ¶
func (b ListComponent) SupportsAdd() bool
func (ListComponent) SupportsRefresh ¶
func (b ListComponent) SupportsRefresh() bool
type ListItem ¶
type ListItem struct {
Val string
}
func (ListItem) Description ¶
func (ListItem) FilterValue ¶
type TableComponent ¶
type TableComponent struct {
// contains filtered or unexported fields
}
func (TableComponent) ActionActive ¶ added in v1.1.0
func (b TableComponent) ActionActive() bool
func (TableComponent) ActionLoading ¶ added in v1.1.0
func (b TableComponent) ActionLoading() bool
func (*TableComponent) ApplyActionResult ¶ added in v1.1.0
func (c *TableComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*TableComponent) BeginAction ¶ added in v1.1.0
func (c *TableComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (TableComponent) GetAddInput ¶
func (b TableComponent) GetAddInput() string
func (*TableComponent) HandleAddMode ¶
func (TableComponent) IsFocusable ¶
func (b TableComponent) IsFocusable() bool
func (*TableComponent) ResetAction ¶ added in v1.1.0
func (c *TableComponent) ResetAction() (Component, tea.Cmd)
func (*TableComponent) SetContent ¶
func (c *TableComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (TableComponent) SupportsAdd ¶
func (b TableComponent) SupportsAdd() bool
func (TableComponent) SupportsRefresh ¶
func (b TableComponent) SupportsRefresh() bool
type TextComponent ¶
type TextComponent struct {
// contains filtered or unexported fields
}
func (TextComponent) ActionActive ¶ added in v1.1.0
func (b TextComponent) ActionActive() bool
func (TextComponent) ActionLoading ¶ added in v1.1.0
func (b TextComponent) ActionLoading() bool
func (*TextComponent) ApplyActionResult ¶ added in v1.1.0
func (c *TextComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*TextComponent) BeginAction ¶ added in v1.1.0
func (c *TextComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (TextComponent) GetAddInput ¶
func (b TextComponent) GetAddInput() string
func (*TextComponent) HandleAddMode ¶
func (TextComponent) IsFocusable ¶
func (b TextComponent) IsFocusable() bool
func (*TextComponent) ResetAction ¶ added in v1.1.0
func (c *TextComponent) ResetAction() (Component, tea.Cmd)
func (*TextComponent) SetContent ¶
func (c *TextComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (TextComponent) SupportsAdd ¶
func (b TextComponent) SupportsAdd() bool
func (TextComponent) SupportsRefresh ¶
func (b TextComponent) SupportsRefresh() bool
type TodoComponent ¶
type TodoComponent struct {
// contains filtered or unexported fields
}
func (TodoComponent) ActionActive ¶ added in v1.1.0
func (b TodoComponent) ActionActive() bool
func (TodoComponent) ActionLoading ¶ added in v1.1.0
func (b TodoComponent) ActionLoading() bool
func (*TodoComponent) ApplyActionResult ¶ added in v1.1.0
func (c *TodoComponent) ApplyActionResult(pendingID, out, outputAs string) (Component, tea.Cmd)
func (*TodoComponent) BeginAction ¶ added in v1.1.0
func (c *TodoComponent) BeginAction(label, outputAs, pendingID string) (Component, tea.Cmd)
func (*TodoComponent) GetAddInput ¶
func (c *TodoComponent) GetAddInput() string
func (*TodoComponent) HandleAddMode ¶
func (TodoComponent) IsFocusable ¶
func (b TodoComponent) IsFocusable() bool
func (*TodoComponent) ResetAction ¶ added in v1.1.0
func (c *TodoComponent) ResetAction() (Component, tea.Cmd)
func (*TodoComponent) SetContent ¶
func (c *TodoComponent) SetContent(result data.FetchOutput) (Component, tea.Cmd)
func (*TodoComponent) SupportsAdd ¶
func (c *TodoComponent) SupportsAdd() bool
func (TodoComponent) SupportsRefresh ¶
func (b TodoComponent) SupportsRefresh() bool
type TodoFetchOutput ¶
type TodoFetchOutput struct {
Err error
TodoItems []*data.TodoOutput
}
func (*TodoFetchOutput) Error ¶
func (t *TodoFetchOutput) Error() error
func (*TodoFetchOutput) Items ¶
func (t *TodoFetchOutput) Items() []*data.TodoOutput
func (*TodoFetchOutput) Output ¶
func (t *TodoFetchOutput) Output() string
type TodoListItem ¶
type TodoListItem struct {
*data.TodoOutput
Index int
// contains filtered or unexported fields
}
func (TodoListItem) Description ¶
func (i TodoListItem) Description() string
func (TodoListItem) FilterValue ¶
func (i TodoListItem) FilterValue() string
func (TodoListItem) Title ¶
func (i TodoListItem) Title() string
Click to show internal directories.
Click to hide internal directories.