form

package
v0.0.0-...-045c0c7 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FocusedColor = lipgloss.Color("205")
)

Functions

This section is empty.

Types

type Button

type Button struct {
	// contains filtered or unexported fields
}

func NewButton

func NewButton(text string, cb func() tea.Cmd) *Button

func (*Button) Blur

func (b *Button) Blur()

func (*Button) Focus

func (b *Button) Focus() tea.Cmd

func (*Button) Update

func (b *Button) Update(msg tea.Msg) (Field, bool, tea.Cmd)

func (*Button) Value

func (b *Button) Value() interface{}

func (*Button) View

func (b *Button) View() string

type Field

type Field interface {
	Focus() tea.Cmd
	Blur()
	Update(tea.Msg) (Field, bool, tea.Cmd)
	View() string
	Value() interface{}
}

type Form

type Form struct {
	Fields     map[string]Field
	FieldOrder []string
	Debug      bool
	// contains filtered or unexported fields
}

func (Form) Init

func (f Form) Init() tea.Cmd

func (Form) Update

func (f Form) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Form) Values

func (f Form) Values() map[string]interface{}

func (Form) View

func (f Form) View() string

type Select

type Select struct {
	Prompt string
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect(prompt string, columns []string, options ...table.Row) *Select

func (*Select) Blur

func (s *Select) Blur()

func (*Select) Focus

func (s *Select) Focus() tea.Cmd

func (*Select) Rows

func (s *Select) Rows() []table.Row

func (*Select) SetRows

func (s *Select) SetRows(r []table.Row)

func (*Select) Update

func (s *Select) Update(msg tea.Msg) (Field, bool, tea.Cmd)

func (*Select) Value

func (s *Select) Value() interface{}

func (*Select) View

func (s *Select) View() string

type TextField

type TextField struct {
	textinput.Model
}

func NewTextField

func NewTextField(prompt string, defaultValue string) *TextField

func (*TextField) Blur

func (t *TextField) Blur()

func (*TextField) Focus

func (t *TextField) Focus() tea.Cmd

func (*TextField) Update

func (t *TextField) Update(msg tea.Msg) (Field, bool, tea.Cmd)

func (*TextField) Value

func (t *TextField) Value() interface{}

Jump to

Keyboard shortcuts

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