inputs

package
v0.0.0-...-abce128 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input interface {
	Update(msg tea.Msg) (Input, tea.Cmd)
	Blur()
	Focus() tea.Cmd
	Value() string
	View() string
	SetWidth(width int)
	SetHeight(height int)
	SetReadOnly(readOnly bool)
	SetValue(value string)
	SetCharLimit(charLimit int)
}

type InputWrapper

type InputWrapper struct {
	Model *textinput.Model
	// contains filtered or unexported fields
}

InputWrapper wraps textinput.Model to implement the Input interface

func NewInputWrapper

func NewInputWrapper(
	placeHolder string,
	style InputWrapperStyle,
) *InputWrapper

func (*InputWrapper) Blur

func (w *InputWrapper) Blur()

func (*InputWrapper) Focus

func (w *InputWrapper) Focus() tea.Cmd

func (*InputWrapper) SetCharLimit

func (w *InputWrapper) SetCharLimit(charLimit int)

func (*InputWrapper) SetHeight

func (*InputWrapper) SetHeight(_ int)

func (*InputWrapper) SetReadOnly

func (w *InputWrapper) SetReadOnly(readOnly bool)

func (*InputWrapper) SetValue

func (w *InputWrapper) SetValue(value string)

func (*InputWrapper) SetWidth

func (w *InputWrapper) SetWidth(width int)

func (*InputWrapper) Update

func (w *InputWrapper) Update(msg tea.Msg) (Input, tea.Cmd)

Update implements the Input interface

func (*InputWrapper) Value

func (w *InputWrapper) Value() string

func (*InputWrapper) View

func (w *InputWrapper) View() string

type InputWrapperStyle

type InputWrapperStyle interface {
	GetInputWrapperWarningStyle() *lipgloss.Style
}

type TextAreaWrapper

type TextAreaWrapper struct {
	*textarea.Model
	// contains filtered or unexported fields
}

TextAreaWrapper wraps textarea.Model to implement the Input interface

func NewTextAreaWrapper

func NewTextAreaWrapper(
	height int, placeHolder string,
	style TextAreaWrapperStyle,
	options ...TextAreaWrapperOption,
) *TextAreaWrapper

func (*TextAreaWrapper) Blur

func (w *TextAreaWrapper) Blur()

Blur implements the Input interface

func (*TextAreaWrapper) Focus

func (w *TextAreaWrapper) Focus() tea.Cmd

Focus implements the Input interface

func (*TextAreaWrapper) SetCharLimit

func (w *TextAreaWrapper) SetCharLimit(charLimit int)

func (*TextAreaWrapper) SetHeight

func (w *TextAreaWrapper) SetHeight(height int)

SetHeight implements the Input interface

func (*TextAreaWrapper) SetReadOnly

func (w *TextAreaWrapper) SetReadOnly(readOnly bool)

SetReadOnly implements the Input interface

func (*TextAreaWrapper) SetValue

func (w *TextAreaWrapper) SetValue(value string)

SetValue implements the Input interface

func (*TextAreaWrapper) SetWidth

func (w *TextAreaWrapper) SetWidth(width int)

SetWidth implements the Input interface

func (*TextAreaWrapper) Update

func (w *TextAreaWrapper) Update(msg tea.Msg) (Input, tea.Cmd)

Update implements the Input interface

func (*TextAreaWrapper) Value

func (w *TextAreaWrapper) Value() string

Value implements the Input interface

func (*TextAreaWrapper) View

func (w *TextAreaWrapper) View() string

View implements the Input interface

type TextAreaWrapperOption

type TextAreaWrapperOption func(*TextAreaWrapper) error

func WithMarkdown

func WithMarkdown(markdownWordWrapWidth int) TextAreaWrapperOption

type TextAreaWrapperStyle

type TextAreaWrapperStyle interface {
	GetTextAreaWrapperWarningStyle() *lipgloss.Style
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL