Documentation
¶
Index ¶
- type Dialog
- type Field
- type MultiSelectField
- func (f *MultiSelectField) Blur()
- func (f *MultiSelectField) Focus() tea.Cmd
- func (f *MultiSelectField) Focused() bool
- func (f *MultiSelectField) IsFiltering() bool
- func (f *MultiSelectField) Label() string
- func (f *MultiSelectField) SelectedIndices() []int
- func (f *MultiSelectField) Update(msg tea.Msg) (Field, tea.Cmd)
- func (f *MultiSelectField) Value() any
- func (f *MultiSelectField) View() string
- type ProjectSelectorField
- func (f *ProjectSelectorField) Blur()
- func (f *ProjectSelectorField) Focus() tea.Cmd
- func (f *ProjectSelectorField) Focused() bool
- func (f *ProjectSelectorField) Label() string
- func (f *ProjectSelectorField) Update(msg tea.Msg) (Field, tea.Cmd)
- func (f *ProjectSelectorField) Value() any
- func (f *ProjectSelectorField) View() string
- type Repo
- type SelectFormField
- func (f *SelectFormField) Blur()
- func (f *SelectFormField) Focus() tea.Cmd
- func (f *SelectFormField) Focused() bool
- func (f *SelectFormField) IsFiltering() bool
- func (f *SelectFormField) Label() string
- func (f *SelectFormField) Update(msg tea.Msg) (Field, tea.Cmd)
- func (f *SelectFormField) Value() any
- func (f *SelectFormField) View() string
- type SessionSelectorField
- func (f *SessionSelectorField) Blur()
- func (f *SessionSelectorField) Focus() tea.Cmd
- func (f *SessionSelectorField) Focused() bool
- func (f *SessionSelectorField) Label() string
- func (f *SessionSelectorField) Update(msg tea.Msg) (Field, tea.Cmd)
- func (f *SessionSelectorField) Value() any
- func (f *SessionSelectorField) View() string
- type TextAreaField
- type TextField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialog ¶
type Dialog struct {
Title string
// contains filtered or unexported fields
}
Dialog is a form container that manages focus cycling, submission, and cancellation across a set of form fields.
func NewDialog ¶
NewDialog creates a form dialog with the given fields and variable names. The first field is focused automatically.
func (*Dialog) FormValues ¶
FormValues returns a map of variable names to field values.
type Field ¶
type Field interface {
Update(msg tea.Msg) (Field, tea.Cmd)
View() string
Focus() tea.Cmd
Blur()
Focused() bool
Value() any // string for text/textarea/select, []string for multi-select, domain types for presets
Label() string // Display label for the field
}
Field is the interface implemented by all form field types.
type MultiSelectField ¶
type MultiSelectField struct {
// contains filtered or unexported fields
}
MultiSelectField is a multi-select form field with checkbox toggles.
func NewMultiSelectFormField ¶
func NewMultiSelectFormField(label string, options []string) *MultiSelectField
NewMultiSelectFormField creates a multi-select field from static options.
func (*MultiSelectField) Blur ¶
func (f *MultiSelectField) Blur()
func (*MultiSelectField) Focus ¶
func (f *MultiSelectField) Focus() tea.Cmd
func (*MultiSelectField) Focused ¶
func (f *MultiSelectField) Focused() bool
func (*MultiSelectField) IsFiltering ¶
func (f *MultiSelectField) IsFiltering() bool
IsFiltering returns whether the list is currently filtering.
func (*MultiSelectField) Label ¶
func (f *MultiSelectField) Label() string
func (*MultiSelectField) SelectedIndices ¶
func (f *MultiSelectField) SelectedIndices() []int
SelectedIndices returns the indices of checked items.
func (*MultiSelectField) Value ¶
func (f *MultiSelectField) Value() any
Value returns the selected options as []string.
func (*MultiSelectField) View ¶
func (f *MultiSelectField) View() string
type ProjectSelectorField ¶
type ProjectSelectorField struct {
// contains filtered or unexported fields
}
ProjectSelectorField is a preset form field for selecting projects/repositories. It composes SelectFormField (single) or MultiSelectField (multi) based on the multi flag, delegating all Field methods except Value().
func NewProjectSelectorField ¶
func NewProjectSelectorField(label string, repos []Repo, multi bool) *ProjectSelectorField
NewProjectSelectorField creates a project selector preset field. When multi is true, it uses MultiSelectField; otherwise SelectFormField.
func (*ProjectSelectorField) Blur ¶
func (f *ProjectSelectorField) Blur()
func (*ProjectSelectorField) Focus ¶
func (f *ProjectSelectorField) Focus() tea.Cmd
func (*ProjectSelectorField) Focused ¶
func (f *ProjectSelectorField) Focused() bool
func (*ProjectSelectorField) Label ¶
func (f *ProjectSelectorField) Label() string
func (*ProjectSelectorField) Value ¶
func (f *ProjectSelectorField) Value() any
Value returns Repo for single-select or []Repo for multi-select.
func (*ProjectSelectorField) View ¶
func (f *ProjectSelectorField) View() string
type Repo ¶
Repo represents a project/repository for the ProjectSelector preset. This is a form-package type to avoid import cycles with the tui package.
type SelectFormField ¶
type SelectFormField struct {
// contains filtered or unexported fields
}
SelectFormField is a single-select form field wrapping list.Model.
func NewSelectFormField ¶
func NewSelectFormField(label string, options []string, defaultVal string) *SelectFormField
NewSelectFormField creates a single-select field from static options. defaultVal pre-selects the matching option if found.
func (*SelectFormField) Blur ¶
func (f *SelectFormField) Blur()
func (*SelectFormField) Focus ¶
func (f *SelectFormField) Focus() tea.Cmd
func (*SelectFormField) Focused ¶
func (f *SelectFormField) Focused() bool
func (*SelectFormField) IsFiltering ¶
func (f *SelectFormField) IsFiltering() bool
IsFiltering returns whether the list is currently filtering.
func (*SelectFormField) Label ¶
func (f *SelectFormField) Label() string
func (*SelectFormField) Value ¶
func (f *SelectFormField) Value() any
func (*SelectFormField) View ¶
func (f *SelectFormField) View() string
type SessionSelectorField ¶
type SessionSelectorField struct {
// contains filtered or unexported fields
}
SessionSelectorField is a preset form field for selecting sessions. It composes SelectFormField (single) or MultiSelectField (multi) based on the multi flag, delegating all Field methods except Value().
func NewSessionSelectorField ¶
func NewSessionSelectorField(label string, sessions []session.Session, multi bool) *SessionSelectorField
NewSessionSelectorField creates a session selector preset field. When multi is true, it uses MultiSelectField; otherwise SelectFormField. Labels are formatted as "repo/session-name" when sessions span multiple remotes.
func (*SessionSelectorField) Blur ¶
func (f *SessionSelectorField) Blur()
func (*SessionSelectorField) Focus ¶
func (f *SessionSelectorField) Focus() tea.Cmd
func (*SessionSelectorField) Focused ¶
func (f *SessionSelectorField) Focused() bool
func (*SessionSelectorField) Label ¶
func (f *SessionSelectorField) Label() string
func (*SessionSelectorField) Value ¶
func (f *SessionSelectorField) Value() any
Value returns session.Session for single-select or []session.Session for multi-select.
func (*SessionSelectorField) View ¶
func (f *SessionSelectorField) View() string
type TextAreaField ¶
type TextAreaField struct {
// contains filtered or unexported fields
}
TextAreaField is a multi-line text input form field.
func NewTextAreaField ¶
func NewTextAreaField(label, placeholder, defaultVal string) *TextAreaField
NewTextAreaField creates a new multi-line text input field.
func (*TextAreaField) Blur ¶
func (f *TextAreaField) Blur()
func (*TextAreaField) Focus ¶
func (f *TextAreaField) Focus() tea.Cmd
func (*TextAreaField) Focused ¶
func (f *TextAreaField) Focused() bool
func (*TextAreaField) Label ¶
func (f *TextAreaField) Label() string
func (*TextAreaField) Value ¶
func (f *TextAreaField) Value() any
func (*TextAreaField) View ¶
func (f *TextAreaField) View() string
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
TextField is a single-line text input form field.
func NewTextField ¶
NewTextField creates a new single-line text input field.