metadata

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInputKeyMap = InputKeyMap{
	SUBMIT: key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "submit")),
	CANCEL: key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "cancel")),
}
View Source
var DefaultKeyMap = KeyMap{
	PREV:  key.NewBinding(key.WithKeys("up", "k"), key.WithHelp("↑/k", "previous")),
	NEXT:  key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "next")),
	FOCUS: key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "focus")),
	CLEAR: key.NewBinding(key.WithKeys("ctrl+l"), key.WithHelp("ctrl+l", "clear")),
}

Functions

This section is empty.

Types

type Field

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

func NewField

func NewField(name, id, defaultVal string, options ...FieldOption) Field

type FieldOption

type FieldOption func(*Field)

func UpdatesFrom

func UpdatesFrom(concatChar rune, fields ...int) FieldOption
func WithLink(linkedField ...int) FieldOption

type FieldValue

type FieldValue struct {
	Id    string
	Value string
}

type InputKeyMap

type InputKeyMap struct {
	SUBMIT key.Binding
	CANCEL key.Binding
}

func (InputKeyMap) FullHelp

func (k InputKeyMap) FullHelp() [][]key.Binding

func (InputKeyMap) ShortHelp

func (k InputKeyMap) ShortHelp() []key.Binding

type KeyMap

type KeyMap struct {
	PREV  key.Binding
	NEXT  key.Binding
	FOCUS key.Binding
	CLEAR key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type Model

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

func New

func New(fields ...Field) Model

func (Model) FullHelp

func (m Model) FullHelp() [][]key.Binding

func (Model) GetSize

func (m Model) GetSize() (h, v int)

func (Model) GetValues

func (m Model) GetValues() []FieldValue

func (*Model) SetSize

func (m *Model) SetSize(h, v int)

func (Model) ShortHelp

func (m Model) ShortHelp() []key.Binding

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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