form

package
v0.6.9-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

func NewError

func NewError(message, field string, value interface{}) *Error

func (*Error) Field

func (E *Error) Field() string

func (*Error) Message

func (E *Error) Message() string

func (*Error) String

func (E *Error) String() string

func (*Error) Value

func (E *Error) Value() interface{}

type Flex

type Flex struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewFlex

func NewFlex(name string) *Flex

func (*Flex) AddButton

func (F *Flex) AddButton(button FormButton, fixedSize, proportion int)

func (*Flex) AddItem

func (F *Flex) AddItem(item FormItem, fixedSize, proportion int)

func (*Flex) GetButton

func (F *Flex) GetButton(name string) FormButton

func (*Flex) GetButtons

func (F *Flex) GetButtons() []FormButton

func (*Flex) GetItem

func (F *Flex) GetItem(name string) FormItem

func (*Flex) GetItems

func (F *Flex) GetItems() []FormItem

func (*Flex) GetValues

func (F *Flex) GetValues() (values map[string]interface{})

func (*Flex) Name

func (F *Flex) Name() string

func (*Flex) SetFinishedFunction

func (F *Flex) SetFinishedFunction(handler func(key tcell.Key))

func (*Flex) SetValues

func (F *Flex) SetValues(values map[string]interface{})

type Form

type Form interface {
	tview.Primitive

	Name() string

	GetValues() (values map[string]interface{})
	SetValues(values map[string]interface{})

	AddItem(name string, item FormItem, taborder, proportion int)
	GetItem(name string) FormItem
	GetItems(name string) []FormItem

	AddButton(name string, button FormButton, taborder, proportion int)
	GetButton(name string) FormButton
	GetButtons(name string) []FormButton
}

type FormBase

type FormBase struct {
	*Flex
	// contains filtered or unexported fields
}

func New

func New(name string) *FormBase

func (*FormBase) Focus

func (f *FormBase) Focus(delegate func(p tview.Primitive))

type FormButton

type FormButton interface {
	tview.Primitive

	Name() string

	OnSubmit()

	SetBlurFunction(handler func(key tcell.Key))
}

type FormError

type FormError interface {
	Field() string
	Message() string
	Value() interface{}
	String() string
}

type FormItem

type FormItem interface {
	tview.Primitive

	Name() string

	GetValues() (values map[string]interface{})
	SetValues(values map[string]interface{})

	SetFinishedFunction(handler func(key tcell.Key))
}

type RequiredError

type RequiredError struct {
	*Error
}

func NewRequiredError

func NewRequiredError(field string) *RequiredError

type ValidationError

type ValidationError struct {
	*Error
}

func NewValidationError

func NewValidationError(field, validationMessage string, value interface{}) *ValidationError

Jump to

Keyboard shortcuts

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