dialog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptMsg

type AcceptMsg struct{}

AcceptMsg send when the accept event triggerd

type Dialog

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

Dialog confirmation component model.

func New

func New(text string, opts ...OptFunc) Dialog

New returns a new Dialog

func (Dialog) FullHelp

func (d Dialog) FullHelp() [][]key.Binding

FullHelp returns the full help for the key bindings

func (Dialog) Init

func (d Dialog) Init() tea.Cmd

Init dialog

func (Dialog) Reset

func (d Dialog) Reset() Dialog

Reset resets the Dialog options.

func (Dialog) ShortHelp

func (d Dialog) ShortHelp() []key.Binding

ShortHelp returns the short help for the key bindings

func (Dialog) Update

func (d Dialog) Update(msg tea.Msg) (Dialog, tea.Cmd)

Update handles the input events.

func (Dialog) View

func (d Dialog) View() string

View renders the Dialog content.

type DiscardMsg

type DiscardMsg struct{}

DiscardMsg send when the discard event triggerd

type InitMsg

type InitMsg struct{}

InitMsg send when the confirmation panenl is opened

type KeyMap

type KeyMap struct {
	Discard  key.Binding
	Accept   key.Binding
	Navigate key.Binding
}

type OptFunc

type OptFunc func(*Dialog)

OptFunc optional configs for the Dialog.

func WithButtonNames

func WithButtonNames(accept, cancel string) OptFunc

WithButtonNames used for setting custom names for the buttons.

type StyleMap

type StyleMap struct {
	Button       lipgloss.Style
	ActiveButton lipgloss.Style
	Box          lipgloss.Style
}

Jump to

Keyboard shortcuts

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