settings

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Label    string
	Key      string
	Value    string
	Type     FieldType
	Options  []string
	Masked   bool
	ReadOnly bool
	Disabled bool
}

func (Field) BoolValue

func (f Field) BoolValue() bool

func (Field) DisplayValue

func (f Field) DisplayValue(editing bool) string

func (*Field) SetBoolValue

func (f *Field) SetBoolValue(value bool)

type FieldType

type FieldType int
const (
	FieldText FieldType = iota
	FieldToggle
	FieldSelect
	FieldAction // triggers a command when enter/space is pressed
)

type SaveFieldMsg

type SaveFieldMsg struct {
	SectionTitle string
	Field        Field
}

type Section

type Section struct {
	Title  string
	Group  string // optional group label shown as header in sidebar
	Fields []Field
	// contains filtered or unexported fields
}

func (*Section) ActiveField

func (s *Section) ActiveField() *Field

func (*Section) IsEditing

func (s *Section) IsEditing() bool

func (*Section) SetWidth

func (s *Section) SetWidth(width int)

func (*Section) Update

func (s *Section) Update(msg tea.Msg) tea.Cmd

func (*Section) View

func (s *Section) View(width int, active bool) string

type SelectFieldCmp

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

func NewSelectFieldCmp

func NewSelectFieldCmp(field Field, width int) SelectFieldCmp

func (*SelectFieldCmp) SetWidth

func (c *SelectFieldCmp) SetWidth(width int)

func (*SelectFieldCmp) Update

func (c *SelectFieldCmp) Update(msg tea.Msg) (tea.Cmd, bool)

func (SelectFieldCmp) Value

func (c SelectFieldCmp) Value() string

func (SelectFieldCmp) View

func (c SelectFieldCmp) View() string

type SettingsCmp

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

func NewSettingsCmp

func NewSettingsCmp() SettingsCmp

func (*SettingsCmp) ActiveSection

func (m *SettingsCmp) ActiveSection() *Section

func (SettingsCmp) Init

func (m SettingsCmp) Init() tea.Cmd

func (*SettingsCmp) Sections

func (m *SettingsCmp) Sections() []Section

func (*SettingsCmp) SetActiveField

func (m *SettingsCmp) SetActiveField(sectionTitle, fieldKey string)

func (*SettingsCmp) SetSections

func (m *SettingsCmp) SetSections(sections []Section)

func (*SettingsCmp) SetSize

func (m *SettingsCmp) SetSize(width, height int)

func (SettingsCmp) Update

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

func (SettingsCmp) View

func (m SettingsCmp) View() string

type TextFieldCmp

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

func NewTextFieldCmp

func NewTextFieldCmp(field Field, width int) TextFieldCmp

func (*TextFieldCmp) SetWidth

func (c *TextFieldCmp) SetWidth(width int)

func (*TextFieldCmp) Update

func (c *TextFieldCmp) Update(msg tea.Msg) (tea.Cmd, bool)

func (TextFieldCmp) Value

func (c TextFieldCmp) Value() string

func (TextFieldCmp) View

func (c TextFieldCmp) View() string

type ToggleFieldCmp

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

func NewToggleFieldCmp

func NewToggleFieldCmp(field Field) ToggleFieldCmp

func (*ToggleFieldCmp) SetWidth

func (c *ToggleFieldCmp) SetWidth(width int)

func (*ToggleFieldCmp) Update

func (c *ToggleFieldCmp) Update(msg tea.Msg) (tea.Cmd, bool)

func (ToggleFieldCmp) Value

func (c ToggleFieldCmp) Value() string

func (ToggleFieldCmp) View

func (c ToggleFieldCmp) View() string

Jump to

Keyboard shortcuts

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