Documentation
¶
Overview ¶
Package inputdialog provides a simple modal input dialog for capturing text input. Used for naming resources like snapshots and images.
Index ¶
- type InputCancelMsg
- type InputConfirmMsg
- type InputDialog
- func (d *InputDialog) HasTextInputFocused() bool
- func (d *InputDialog) Init() tea.Cmd
- func (d *InputDialog) SetCheckbox(label string, defaultValue bool) *InputDialog
- func (d *InputDialog) SetSize(width, height int)
- func (d *InputDialog) SetValidator(v forms.Validator) *InputDialog
- func (d *InputDialog) SetWarning(warning string) *InputDialog
- func (d *InputDialog) Update(msg tea.Msg) tea.Cmd
- func (d *InputDialog) Value() string
- func (d *InputDialog) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputCancelMsg ¶
type InputCancelMsg struct{}
InputCancelMsg is sent when user cancels the dialog
type InputConfirmMsg ¶
type InputConfirmMsg struct {
Value string
CheckboxValue bool // Value of optional checkbox if shown
}
InputConfirmMsg is sent when user confirms the input
type InputDialog ¶
type InputDialog struct {
// contains filtered or unexported fields
}
InputDialog represents a modal input dialog
func (*InputDialog) HasTextInputFocused ¶
func (d *InputDialog) HasTextInputFocused() bool
HasTextInputFocused returns true since this dialog always has text input focused
func (*InputDialog) SetCheckbox ¶
func (d *InputDialog) SetCheckbox(label string, defaultValue bool) *InputDialog
SetCheckbox adds an optional checkbox with the given label
func (*InputDialog) SetSize ¶
func (d *InputDialog) SetSize(width, height int)
SetSize updates the dialog dimensions
func (*InputDialog) SetValidator ¶
func (d *InputDialog) SetValidator(v forms.Validator) *InputDialog
SetValidator sets a custom validator for the input
func (*InputDialog) SetWarning ¶
func (d *InputDialog) SetWarning(warning string) *InputDialog
SetWarning sets a warning message to display above the input
func (*InputDialog) Update ¶
func (d *InputDialog) Update(msg tea.Msg) tea.Cmd
Update handles input for the dialog
func (*InputDialog) Value ¶
func (d *InputDialog) Value() string
Value returns the current input value