Documentation
¶
Index ¶
- Variables
- func NewBlurEventCmd() tea.Cmd
- func NewFocusEventCmd() tea.Cmd
- func NewRecomputeFocusableElements() tea.Cmd
- func NewRemoveFocusCmd() tea.Cmd
- func NewUpdateSelectorItems[T any](id int, data []T) tea.Cmd
- func NewUpdateStatusSpinnerCmd(id int, status Status, err error) tea.Cmd
- func NewUpdateTableDataCmd[T any](id int, data [][]T) tea.Cmd
- func NewValueErrPairCmd[T any](raw string, op func(raw string) ValueErrPair[T]) tea.Cmd
- type BlurEvent
- type Button
- type Column
- func (l *Column) Blur()
- func (l *Column) CanFocus() bool
- func (l *Column) Focus()
- func (l *Column) FocusableElements() []Composeable
- func (l *Column) Focused() bool
- func (l *Column) Hover()
- func (l *Column) Hovered() bool
- func (l *Column) Init() tea.Cmd
- func (l *Column) UnHover()
- func (c *Column) Update(msg tea.Msg) tea.Cmd
- func (c *Column) View() string
- type Composeable
- type DataTable
- func (d *DataTable[T]) Blur()
- func (d *DataTable[T]) CanFocus() bool
- func (d *DataTable[T]) Focus()
- func (d *DataTable[T]) FocusableElements() []Composeable
- func (d *DataTable[T]) Focused() bool
- func (d *DataTable[T]) Init() tea.Cmd
- func (d *DataTable[T]) SetCustomUpdate(customUpdate func(tea.Msg) tea.Cmd) *DataTable[T]
- func (d *DataTable[T]) SetHeadersAndData(headers []string, data [][]T, maxWidths []int) *DataTable[T]
- func (d *DataTable[T]) Update(msg tea.Msg) tea.Cmd
- func (d *DataTable[T]) View() string
- type FocusEvent
- type HoveredFocused
- type InputValue
- func (i *InputValue[T]) Blur()
- func (i *InputValue[T]) CanFocus() bool
- func (i *InputValue[T]) Focus()
- func (i *InputValue[T]) FocusableElements() []Composeable
- func (i *InputValue[T]) Focused() bool
- func (i *InputValue[T]) GetValue() *T
- func (i *InputValue[T]) Hovered() bool
- func (i *InputValue[T]) Init() tea.Cmd
- func (i *InputValue[T]) SetData(d *T, err *error) *InputValue[T]
- func (i *InputValue[T]) SetFormater(fmter func(v T) string) *InputValue[T]
- func (i *InputValue[T]) SetInputChanedCmd(cmd tea.Cmd) *InputValue[T]
- func (i *InputValue[T]) SetParser(parser func(raw string) ValueErrPair[T]) *InputValue[T]
- func (i *InputValue[T]) SetPrompt(prompt string) *InputValue[T]
- func (i *InputValue[T]) SetTextInput(placeholder string, charLimit int) *InputValue[T]
- func (i *InputValue[T]) Update(msg tea.Msg) tea.Cmd
- func (i *InputValue[T]) View() string
- type RecomputeFocusableElements
- type RemoveFocus
- type Row
- func (l *Row) Blur()
- func (l *Row) CanFocus() bool
- func (l *Row) Focus()
- func (l *Row) FocusableElements() []Composeable
- func (l *Row) Focused() bool
- func (l *Row) Hover()
- func (l *Row) Hovered() bool
- func (l *Row) Init() tea.Cmd
- func (l *Row) UnHover()
- func (r *Row) Update(msg tea.Msg) tea.Cmd
- func (r *Row) View() string
- type Selector
- func (s *Selector[T, U]) CanFocus() bool
- func (s *Selector[T, U]) FocusableElements() []Composeable
- func (s *Selector[T, U]) Init() tea.Cmd
- func (s *Selector[T, U]) SetCustomUpdate(customUpdate func(tea.Msg) tea.Cmd) *Selector[T, U]
- func (s *Selector[T, U]) SetSelectedItem(v **T) *Selector[T, U]
- func (s *Selector[T, U]) SetSelectionCmd(cmd tea.Cmd) *Selector[T, U]
- func (s *Selector[T, U]) Update(msg tea.Msg) tea.Cmd
- func (s *Selector[T, U]) View() string
- type Status
- type StatusSpinner
- func (s *StatusSpinner) Blur()
- func (s *StatusSpinner) CanFocus() bool
- func (s *StatusSpinner) Focus()
- func (s *StatusSpinner) FocusableElements() []Composeable
- func (s *StatusSpinner) Focused() bool
- func (s *StatusSpinner) Hover()
- func (s *StatusSpinner) Hovered() bool
- func (s *StatusSpinner) Init() tea.Cmd
- func (s *StatusSpinner) SetErrMsg(m string) *StatusSpinner
- func (s *StatusSpinner) SetGoodMsg(m string) *StatusSpinner
- func (s *StatusSpinner) SetWaitingMsg(m string) *StatusSpinner
- func (s *StatusSpinner) UnHover()
- func (s *StatusSpinner) Update(msg tea.Msg) tea.Cmd
- func (s *StatusSpinner) View() string
- type Tabs
- func (t *Tabs) Blur()
- func (t *Tabs) CanFocus() bool
- func (t *Tabs) Focus()
- func (t *Tabs) FocusableElements() []Composeable
- func (t *Tabs) Focused() bool
- func (t *Tabs) Hover()
- func (t *Tabs) Hovered() bool
- func (t *Tabs) Init() tea.Cmd
- func (t *Tabs) UnHover()
- func (t *Tabs) Update(msg tea.Msg) tea.Cmd
- func (t *Tabs) View() string
- type UpdateSelectorItems
- type UpdateStatusSpinner
- type UpdateTableData
- type ValueErrPair
- type Window
- type WindowKeyBindingModes
- type WindowKeyBindings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultWindowStyle = lg.NewStyle().Border(lg.RoundedBorder()).Margin(1, 1) DefaultBadStatusStyle = lg.NewStyle(). Foreground(lg.AdaptiveColor{Light: "#ad0000", Dark: "#820000"}) DefaultGoodStatusStyle = lg.NewStyle(). Foreground(lg.AdaptiveColor{Light: "#00db0f", Dark: "#005706"}) DefaultWarnStatusStyle = lg.NewStyle(). Foreground(lg.AdaptiveColor{Light: "#fcba03", Dark: "#fcba03"}) )
Functions ¶
func NewBlurEventCmd ¶
func NewFocusEventCmd ¶
func NewRemoveFocusCmd ¶
func NewValueErrPairCmd ¶
Types ¶
type Button ¶
type Button struct {
HoveredFocused
Style lg.Style
// contains filtered or unexported fields
}
func (*Button) FocusableElements ¶
func (b *Button) FocusableElements() []Composeable
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
func (*Column) FocusableElements ¶
func (l *Column) FocusableElements() []Composeable
type Composeable ¶
type DataTable ¶
type DataTable[T any] struct { HoveredFocused table.Model Style lg.Style // contains filtered or unexported fields }
func (*DataTable[T]) FocusableElements ¶
func (d *DataTable[T]) FocusableElements() []Composeable
func (*DataTable[T]) SetCustomUpdate ¶
func (*DataTable[T]) SetHeadersAndData ¶
type FocusEvent ¶
type FocusEvent struct{}
type HoveredFocused ¶
type HoveredFocused struct {
// contains filtered or unexported fields
}
func (*HoveredFocused) Blur ¶
func (h *HoveredFocused) Blur()
func (*HoveredFocused) Focus ¶
func (h *HoveredFocused) Focus()
func (*HoveredFocused) Focused ¶
func (h *HoveredFocused) Focused() bool
func (*HoveredFocused) Hover ¶
func (h *HoveredFocused) Hover()
func (*HoveredFocused) Hovered ¶
func (h *HoveredFocused) Hovered() bool
func (*HoveredFocused) UnHover ¶
func (h *HoveredFocused) UnHover()
type InputValue ¶
type InputValue[T any] struct { textinput.Model HoveredFocused Err *error Data *T Style lg.Style Prompt string Parse func(raw string) ValueErrPair[T] Format func(v T) string // contains filtered or unexported fields }
func NewInputValue ¶
func NewInputValue[T any](style lg.Style) *InputValue[T]
func (*InputValue[T]) Blur ¶
func (i *InputValue[T]) Blur()
func (*InputValue[T]) CanFocus ¶
func (i *InputValue[T]) CanFocus() bool
func (*InputValue[T]) Focus ¶
func (i *InputValue[T]) Focus()
func (*InputValue[T]) FocusableElements ¶
func (i *InputValue[T]) FocusableElements() []Composeable
func (*InputValue[T]) Focused ¶
func (i *InputValue[T]) Focused() bool
func (*InputValue[T]) GetValue ¶
func (i *InputValue[T]) GetValue() *T
func (*InputValue[T]) Hovered ¶
func (i *InputValue[T]) Hovered() bool
func (*InputValue[T]) Init ¶
func (i *InputValue[T]) Init() tea.Cmd
func (*InputValue[T]) SetData ¶
func (i *InputValue[T]) SetData(d *T, err *error) *InputValue[T]
func (*InputValue[T]) SetFormater ¶
func (i *InputValue[T]) SetFormater(fmter func(v T) string) *InputValue[T]
func (*InputValue[T]) SetInputChanedCmd ¶
func (i *InputValue[T]) SetInputChanedCmd(cmd tea.Cmd) *InputValue[T]
func (*InputValue[T]) SetParser ¶
func (i *InputValue[T]) SetParser( parser func(raw string) ValueErrPair[T], ) *InputValue[T]
func (*InputValue[T]) SetPrompt ¶
func (i *InputValue[T]) SetPrompt(prompt string) *InputValue[T]
func (*InputValue[T]) SetTextInput ¶
func (i *InputValue[T]) SetTextInput( placeholder string, charLimit int, ) *InputValue[T]
func (*InputValue[T]) View ¶
func (i *InputValue[T]) View() string
type RecomputeFocusableElements ¶
type RecomputeFocusableElements struct{}
type RemoveFocus ¶
type RemoveFocus struct{}
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
func (*Row) FocusableElements ¶
func (l *Row) FocusableElements() []Composeable
type Selector ¶
type Selector[T any, U interface { *T list.DefaultItem }] struct { HoveredFocused list.Model Style lg.Style GoodStatusStyle lg.Style BadStatusStyle lg.Style // contains filtered or unexported fields }
func NewSelector ¶
func (*Selector[T, U]) FocusableElements ¶
func (s *Selector[T, U]) FocusableElements() []Composeable
func (*Selector[T, U]) SetCustomUpdate ¶
func (*Selector[T, U]) SetSelectedItem ¶
func (*Selector[T, U]) SetSelectionCmd ¶
type StatusSpinner ¶
type StatusSpinner struct {
Status
spinner.Model
Err error
GoodMsg string
WaitingMsg string
ErrMsg string
Style lg.Style
GoodStatusStyle lg.Style
BadStatusStyle lg.Style
WaitingStatusStyle lg.Style
// contains filtered or unexported fields
}
func NewStatusSpinner ¶
func NewStatusSpinner(style lg.Style, id int) *StatusSpinner
func (*StatusSpinner) Blur ¶
func (s *StatusSpinner) Blur()
func (*StatusSpinner) CanFocus ¶
func (s *StatusSpinner) CanFocus() bool
func (*StatusSpinner) Focus ¶
func (s *StatusSpinner) Focus()
func (*StatusSpinner) FocusableElements ¶
func (s *StatusSpinner) FocusableElements() []Composeable
func (*StatusSpinner) Focused ¶
func (s *StatusSpinner) Focused() bool
func (*StatusSpinner) Hover ¶
func (s *StatusSpinner) Hover()
func (*StatusSpinner) Hovered ¶
func (s *StatusSpinner) Hovered() bool
func (*StatusSpinner) Init ¶
func (s *StatusSpinner) Init() tea.Cmd
func (*StatusSpinner) SetErrMsg ¶
func (s *StatusSpinner) SetErrMsg(m string) *StatusSpinner
func (*StatusSpinner) SetGoodMsg ¶
func (s *StatusSpinner) SetGoodMsg(m string) *StatusSpinner
func (*StatusSpinner) SetWaitingMsg ¶
func (s *StatusSpinner) SetWaitingMsg(m string) *StatusSpinner
func (*StatusSpinner) UnHover ¶
func (s *StatusSpinner) UnHover()
func (*StatusSpinner) View ¶
func (s *StatusSpinner) View() string
type Tabs ¶
type Tabs struct {
// contains filtered or unexported fields
}
func (*Tabs) FocusableElements ¶
func (t *Tabs) FocusableElements() []Composeable
type UpdateSelectorItems ¶
type UpdateStatusSpinner ¶
type UpdateTableData ¶
type ValueErrPair ¶
func (ValueErrPair[T]) Error ¶
func (v ValueErrPair[T]) Error() string
type Window ¶
type Window struct {
Root Composeable
Style lg.Style
// contains filtered or unexported fields
}
type WindowKeyBindings ¶
type WindowKeyBindings struct {
// The keyboard short cuts that will navigate to the next focusable
// UI components.
Next key.Binding
// The keyboard short cuts that will navigate to the previous focusable
// UI components.
Prev key.Binding
// The keyboard shortcuts to navigate to the first focusable UI
// component.
First key.Binding
// The keyboard shortcuts to navigate to the last focusable UI
// component.
Last key.Binding
// The keyboard short cuts that will leave navigation mode and enter
// the interactive mode for interacting with UI components.
Focus key.Binding
// The keyboard short cuts that will leave interactive mode and enter
// the navigation mode for navigating the UI components.
Blur key.Binding
Exit key.Binding
}
Defines a set of keybindings that split the UI into two modes: navigation and intaractive mode.
func NewWindowKeyBindings ¶
func NewWindowKeyBindings() WindowKeyBindings
func (WindowKeyBindings) FullHelp ¶
func (w WindowKeyBindings) FullHelp() [][]key.Binding
func (WindowKeyBindings) FullHelpHeight ¶
func (w WindowKeyBindings) FullHelpHeight() int
func (*WindowKeyBindings) SetMode ¶
func (w *WindowKeyBindings) SetMode(mode WindowKeyBindingModes)
func (WindowKeyBindings) ShortHelp ¶
func (w WindowKeyBindings) ShortHelp() []key.Binding
func (WindowKeyBindings) ShortHelpHeight ¶
func (w WindowKeyBindings) ShortHelpHeight() int
Click to show internal directories.
Click to hide internal directories.