form

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) View

func (b *Button) View() string

type Field

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

func NewTextField

func NewTextField(prompt string) Field

type Form

type Form struct {
	Fields []Field

	Debug bool
	// contains filtered or unexported fields
}

func New

func New(fields ...Field) Form

func (Form) Init

func (f Form) Init() tea.Cmd

func (Form) Update

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

func (Form) View

func (f Form) View() string

type Select

type Select struct {
	Options []table.Row
	Prompt  string
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect(promt 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) Update

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

func (*Select) View

func (s *Select) View() string

type TextField

type TextField struct {
	textinput.Model
}

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)

Jump to

Keyboard shortcuts

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