Documentation
¶
Index ¶
- Constants
- Variables
- func IndexString(index int) string
- func NrInputValidator(s string) error
- func PadFieldName(v string, padAmt *int) string
- type Checkbox
- func (c *Checkbox) Init() tea.Cmd
- func (c *Checkbox) IsFocused() bool
- func (c *Checkbox) Label() string
- func (c *Checkbox) SetFocused(v bool)
- func (c *Checkbox) SetValue(v bool)
- func (c *Checkbox) Toggle()
- func (c *Checkbox) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (c *Checkbox) Value() bool
- func (c *Checkbox) View() string
- type ColorProfile
- type FormElement
- func (e *FormElement) Blur()
- func (e *FormElement) Checkbox() *Checkbox
- func (e *FormElement) Description() string
- func (e *FormElement) Focus() tea.Cmd
- func (e *FormElement) IsActive() bool
- func (e *FormElement) Keymap() help.KeyMap
- func (e *FormElement) SetActive()
- func (e *FormElement) SetValue(v any)
- func (e *FormElement) TextInput() *textinput.Model
- func (e *FormElement) Update(msg tea.Msg) (*FormElement, tea.Cmd)
- func (e *FormElement) Value() string
- func (e *FormElement) View() string
- type FormElementOpt
- type JumpInfo
- type Model
- type OptionList
- func (o *OptionList) Init() tea.Cmd
- func (o *OptionList) IsActive() bool
- func (o *OptionList) IsFocused() bool
- func (o *OptionList) SetActive(v bool)
- func (o *OptionList) SetFocused(v bool)
- func (o *OptionList) SetIdx(v int)
- func (o *OptionList) SetQuick(v bool)
- func (o *OptionList) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (o *OptionList) View() string
- type OptionMsg
- type OptionValue
- type Style
- func (s *Style) GetSecondColor() string
- func (s *Style) HelpStyles() help.Styles
- func (s *Style) NewInputModel(prompt, placeholder string, prevSugg *key.Binding, nextSugg *key.Binding, ...) textinput.Model
- func (s *Style) SetThemeIdx(themeIdx int)
- func (s *Style) TextInputSyle(textInput *textinput.Model, prompt, placeholder string)
- type Theme
Constants ¶
View Source
const ( TabGapDistance = 2 HeaderPadDist = 2 FavChar = " ★" AutoplayChar = " Auto" PlayChar = "\u2877" PauseChar = "\u28FF" LineChar = "\u2847" )
View Source
const IndexStringPadAmt = 3
View Source
const MaxFieldLen = 30
Variables ¶
View Source
var Themes = []Theme{ { Name: "Duo Yellow", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Duo Green", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Duo Blue", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Duo Red", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Mono Yellow", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Mono Green", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Mono Blue", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Mono Red", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, { Name: "Grayscale", Dark: ColorProfile{/* contains filtered or unexported fields */}, Light: ColorProfile{/* contains filtered or unexported fields */}, }, }
Functions ¶
func IndexString ¶ added in v0.8.0
func NrInputValidator ¶ added in v0.8.0
func PadFieldName ¶ added in v0.8.0
Types ¶
type Checkbox ¶ added in v0.8.10
type Checkbox struct {
// contains filtered or unexported fields
}
func NewCheckbox ¶ added in v0.8.10
func (*Checkbox) SetFocused ¶ added in v0.8.10
type ColorProfile ¶ added in v0.8.0
type ColorProfile struct {
// contains filtered or unexported fields
}
type FormElement ¶ added in v0.8.0
type FormElement struct {
// contains filtered or unexported fields
}
func NewFormElement ¶ added in v0.8.0
func NewFormElement(opts ...FormElementOpt) *FormElement
func (*FormElement) Blur ¶ added in v0.8.0
func (e *FormElement) Blur()
func (*FormElement) Checkbox ¶ added in v0.8.10
func (e *FormElement) Checkbox() *Checkbox
func (*FormElement) Description ¶ added in v0.8.0
func (e *FormElement) Description() string
func (*FormElement) Focus ¶ added in v0.8.0
func (e *FormElement) Focus() tea.Cmd
Focus: - input: 1.Focus + 2.SetActive(noop) - optionList: 1.Focus
func (*FormElement) IsActive ¶ added in v0.8.0
func (e *FormElement) IsActive() bool
func (*FormElement) Keymap ¶ added in v0.8.0
func (e *FormElement) Keymap() help.KeyMap
func (*FormElement) SetActive ¶ added in v0.8.0
func (e *FormElement) SetActive()
SetActive: - input: noop - optionList: 2.SetActive
func (*FormElement) SetValue ¶ added in v0.8.0
func (e *FormElement) SetValue(v any)
func (*FormElement) TextInput ¶ added in v0.8.0
func (e *FormElement) TextInput() *textinput.Model
func (*FormElement) Update ¶ added in v0.8.0
func (e *FormElement) Update(msg tea.Msg) (*FormElement, tea.Cmd)
func (*FormElement) Value ¶ added in v0.8.0
func (e *FormElement) Value() string
func (*FormElement) View ¶ added in v0.8.0
func (e *FormElement) View() string
type FormElementOpt ¶ added in v0.8.0
type FormElementOpt func(f *FormElement)
func WithCheckbox ¶ added in v0.8.10
func WithCheckbox(c *Checkbox) FormElementOpt
func WithDescription ¶ added in v0.8.0
func WithDescription(desc string) FormElementOpt
func WithOptionList ¶ added in v0.8.0
func WithOptionList(o *OptionList) FormElementOpt
func WithTextInput ¶ added in v0.8.0
func WithTextInput(i *textinput.Model) FormElementOpt
type JumpInfo ¶ added in v0.8.0
type JumpInfo struct {
// contains filtered or unexported fields
}
func (*JumpInfo) JumpTimeout ¶ added in v0.8.0
func (*JumpInfo) LastPosition ¶ added in v0.8.0
func (*JumpInfo) NewPosition ¶ added in v0.8.0
type OptionList ¶ added in v0.8.0
type OptionList struct {
PartialCallbackFn func(int)
DoneCallbackFn func(int)
Keymap optionsKeymap
// contains filtered or unexported fields
}
func NewOptionList ¶ added in v0.8.0
func NewOptionList(prompt string, options []OptionValue, startIdx int, s *Style) OptionList
func (*OptionList) Init ¶ added in v0.8.0
func (o *OptionList) Init() tea.Cmd
func (*OptionList) IsActive ¶ added in v0.8.0
func (o *OptionList) IsActive() bool
IsActive: 1.focused + 2.active
func (*OptionList) IsFocused ¶ added in v0.8.0
func (o *OptionList) IsFocused() bool
IsFocused: 1.focused
func (*OptionList) SetActive ¶ added in v0.8.0
func (o *OptionList) SetActive(v bool)
func (*OptionList) SetFocused ¶ added in v0.8.0
func (o *OptionList) SetFocused(v bool)
func (*OptionList) SetIdx ¶ added in v0.8.0
func (o *OptionList) SetIdx(v int)
func (*OptionList) SetQuick ¶ added in v0.8.0
func (o *OptionList) SetQuick(v bool)
func (*OptionList) View ¶ added in v0.8.0
func (o *OptionList) View() string
type OptionValue ¶ added in v0.8.0
type Style ¶ added in v0.8.0
type Style struct {
PrimaryColorStyle lipgloss.Style
SecondaryColorStyle lipgloss.Style
// general
BaseBold lipgloss.Style
DocStyle lipgloss.Style
StatusBarStyle lipgloss.Style
ViewStyle lipgloss.Style
NoItemsStyle lipgloss.Style
// station delegate
PrefixStyle lipgloss.Style
NowPlayingPrefixStyle lipgloss.Style
SelNowPlayingStyle lipgloss.Style
SelNowPlayingDescStyle lipgloss.Style
SelItemStyle lipgloss.Style
SelDescStyle lipgloss.Style
SelectedBorderStyle lipgloss.Style
SelectedBorderStyleInactive lipgloss.Style
// header
SongTitleStyle lipgloss.Style
ItalicStyle lipgloss.Style
// tabs
InactiveTabBorder lipgloss.Style
InactiveTabInner lipgloss.Style
InactiveTabInnerHighlight lipgloss.Style
ActiveTabBorder lipgloss.Style
ActiveTabInner lipgloss.Style
ActiveTabInnerHighlight lipgloss.Style
TabGap lipgloss.Style
// help
HelpStyle lipgloss.Style
// textInput
PromptStyle lipgloss.Style
SelPromptStyle lipgloss.Style
// station info
InfoFieldNameStyle lipgloss.Style
// history
HistoryDescStyle lipgloss.Style
HistorySelItemStyle lipgloss.Style
HistorySelDescStyle lipgloss.Style
// settings
SettingDescription lipgloss.Style
// contains filtered or unexported fields
}
func (*Style) GetSecondColor ¶ added in v0.8.0
func (*Style) HelpStyles ¶ added in v0.8.0
func (*Style) NewInputModel ¶ added in v0.8.0
func (*Style) SetThemeIdx ¶ added in v0.8.0
type Theme ¶ added in v0.8.0
type Theme struct {
Name string
Dark ColorProfile
Light ColorProfile
}
Click to show internal directories.
Click to hide internal directories.