Documentation
¶
Index ¶
- Variables
- func HideError() tea.Msg
- type HideErrorMsg
- type Model
- type SimplePicker
- func (m SimplePicker) Blur() Model
- func (m SimplePicker) Focus() Model
- func (m SimplePicker) Init() tea.Cmd
- func (m SimplePicker) IsFocused() bool
- func (m SimplePicker) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m SimplePicker) Validate() (updated Model, valid bool)
- func (m SimplePicker) Value() string
- func (m SimplePicker) View() string
- func (m SimplePicker) WithError(err error) Model
- func (m SimplePicker) WithValue(val string) Model
- type SimplePickerItem
- type SingleLineTextInput
- func (m SingleLineTextInput) Blur() Model
- func (m SingleLineTextInput) Focus() Model
- func (m SingleLineTextInput) Init() tea.Cmd
- func (m SingleLineTextInput) IsFocused() bool
- func (m SingleLineTextInput) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m SingleLineTextInput) Validate() (updated Model, valid bool)
- func (m SingleLineTextInput) Value() string
- func (m SingleLineTextInput) View() string
- func (m SingleLineTextInput) WithError(err error) Model
- func (m SingleLineTextInput) WithValue(val string) Model
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ANSIBlack = lipgloss.ANSIColor(0) ANSIRed = lipgloss.ANSIColor(1) ANSIGreen = lipgloss.ANSIColor(2) ANSIYellow = lipgloss.ANSIColor(3) ANSIBlue = lipgloss.ANSIColor(4) ANSIMagenta = lipgloss.ANSIColor(5) ANSICyan = lipgloss.ANSIColor(6) ANSIWhite = lipgloss.ANSIColor(7) )
View Source
var ( SemanticSuccess = ANSIGreen SemanticError = ANSIRed SemanticWarning = ANSIYellow SemanticInfo = ANSICyan )
View Source
var ( StyleForegroundSemanticInfo = lipgloss.NewStyle().Foreground(SemanticInfo) StyleForegroundSemanticSuccess = lipgloss.NewStyle().Foreground(SemanticSuccess) StyleForegroundSemanticError = lipgloss.NewStyle().Foreground(SemanticError) )
Common styles. For complex ones, please define yourselves.
Functions ¶
Types ¶
type HideErrorMsg ¶
type HideErrorMsg struct{}
type Model ¶
type Model interface {
tea.Model
Validate() (Model, bool)
Focus() Model
Blur() Model
IsFocused() bool
Value() string
WithValue(val string) Model
WithError(err error) Model
}
Model is an interface on top of tea.Model. A few methods are added to suit our use case.
type SimplePicker ¶
type SimplePicker struct {
Title string
Prompt string
Items []SimplePickerItem
ValidateFunc func(string) error
Err error
// contains filtered or unexported fields
}
func NewSimplePicker ¶
func NewSimplePicker(picker SimplePicker) SimplePicker
func (SimplePicker) Blur ¶
func (m SimplePicker) Blur() Model
func (SimplePicker) Focus ¶
func (m SimplePicker) Focus() Model
func (SimplePicker) Init ¶
func (m SimplePicker) Init() tea.Cmd
func (SimplePicker) IsFocused ¶
func (m SimplePicker) IsFocused() bool
func (SimplePicker) Validate ¶
func (m SimplePicker) Validate() (updated Model, valid bool)
func (SimplePicker) Value ¶
func (m SimplePicker) Value() string
func (SimplePicker) View ¶
func (m SimplePicker) View() string
func (SimplePicker) WithError ¶
func (m SimplePicker) WithError(err error) Model
func (SimplePicker) WithValue ¶
func (m SimplePicker) WithValue(val string) Model
type SimplePickerItem ¶
type SingleLineTextInput ¶
type SingleLineTextInput struct {
Title string
Prompt string
ValidateFunc func(string) error
IsMasked bool
Err error
// contains filtered or unexported fields
}
func NewSingleLineTextInput ¶
func NewSingleLineTextInput(textInput SingleLineTextInput) SingleLineTextInput
func (SingleLineTextInput) Blur ¶
func (m SingleLineTextInput) Blur() Model
func (SingleLineTextInput) Focus ¶
func (m SingleLineTextInput) Focus() Model
func (SingleLineTextInput) Init ¶
func (m SingleLineTextInput) Init() tea.Cmd
func (SingleLineTextInput) IsFocused ¶
func (m SingleLineTextInput) IsFocused() bool
func (SingleLineTextInput) Validate ¶
func (m SingleLineTextInput) Validate() (updated Model, valid bool)
func (SingleLineTextInput) Value ¶
func (m SingleLineTextInput) Value() string
func (SingleLineTextInput) View ¶
func (m SingleLineTextInput) View() string
func (SingleLineTextInput) WithError ¶
func (m SingleLineTextInput) WithError(err error) Model
func (SingleLineTextInput) WithValue ¶
func (m SingleLineTextInput) WithValue(val string) Model
Click to show internal directories.
Click to hide internal directories.