diff --git a/field_confirm.go b/field_confirm.go index c2a88ed..184f584 100644 --- a/field_confirm.go +++ b/field_confirm.go @@ -165,7 +165,7 @@ func (c *Confirm) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmds []tea.Cmd switch msg := msg.(type) { - case updateFieldMsg: + case UpdateFieldMsg: if ok, hash := c.title.shouldUpdate(); ok { c.title.bindingsHash = hash if !c.title.loadFromCache() { diff --git a/field_input.go b/field_input.go index 3510d52..e14f4c5 100644 --- a/field_input.go +++ b/field_input.go @@ -274,7 +274,7 @@ func (i *Input) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd switch msg := msg.(type) { - case updateFieldMsg: + case UpdateFieldMsg: var cmds []tea.Cmd if ok, hash := i.title.shouldUpdate(); ok { i.title.bindingsHash = hash diff --git a/field_multiselect.go b/field_multiselect.go index faa33ee..974f8d2 100644 --- a/field_multiselect.go +++ b/field_multiselect.go @@ -267,7 +267,7 @@ func (m *MultiSelect[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } switch msg := msg.(type) { - case updateFieldMsg: + case UpdateFieldMsg: var fieldCmds []tea.Cmd if ok, hash := m.title.shouldUpdate(); ok { m.title.bindingsHash = hash diff --git a/field_note.go b/field_note.go index c93125f..82f0bc5 100644 --- a/field_note.go +++ b/field_note.go @@ -162,7 +162,7 @@ func (n *Note) Init() tea.Cmd { return nil } // Update updates the note field. func (n *Note) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { - case updateFieldMsg: + case UpdateFieldMsg: var cmds []tea.Cmd if ok, hash := n.title.shouldUpdate(); ok { n.title.bindingsHash = hash diff --git a/field_select.go b/field_select.go index 81e57d9..706b0f4 100644 --- a/field_select.go +++ b/field_select.go @@ -317,7 +317,7 @@ func (s *Select[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } switch msg := msg.(type) { - case updateFieldMsg: + case UpdateFieldMsg: var cmds []tea.Cmd if ok, hash := s.title.shouldUpdate(); ok { s.title.bindingsHash = hash diff --git a/field_text.go b/field_text.go index a5c3a40..9ae3c99 100644 --- a/field_text.go +++ b/field_text.go @@ -259,7 +259,7 @@ func (t *Text) Update(msg tea.Msg) (tea.Model, tea.Cmd) { t.textarea, cmd = t.textarea.Update(msg) cmds = append(cmds, cmd) t.accessor.Set(t.textarea.Value()) - case updateFieldMsg: + case UpdateFieldMsg: var cmds []tea.Cmd if ok, hash := t.placeholder.shouldUpdate(); ok { t.placeholder.bindingsHash = hash diff --git a/form.go b/form.go index e1afb0d..cf97920 100644 --- a/form.go +++ b/form.go @@ -534,7 +534,7 @@ func (f *Form) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return f, f.CancelCmd } - case nextFieldMsg: + case NextFieldMsg: // Form is progressing to the next field, let's save the value of the current field. field := group.selector.Selected() f.results[field.GetKey()] = field.GetValue() diff --git a/group.go b/group.go index d890751..f1a9899 100644 --- a/group.go +++ b/group.go @@ -157,33 +157,33 @@ func (g *Group) Errors() []error { return errs } -// updateFieldMsg is a message to update the fields of a group that is currently +// UpdateFieldMsg is a message to update the fields of a group that is currently // displayed. // // This is used to update all TitleFunc, DescriptionFunc, and ...Func update // methods to make all fields dynamically update based on user input. -type updateFieldMsg struct{} +type UpdateFieldMsg struct{} -// nextFieldMsg is a message to move to the next field, +// NextFieldMsg is a message to move to the next field, // // each field controls when to send this message such that it is able to use // different key bindings or events to trigger group progression. -type nextFieldMsg struct{} +type NextFieldMsg struct{} -// prevFieldMsg is a message to move to the previous field. +// PrevFieldMsg is a message to move to the previous field. // // each field controls when to send this message such that it is able to use // different key bindings or events to trigger group progression. -type prevFieldMsg struct{} +type PrevFieldMsg struct{} // NextField is the command to move to the next field. func NextField() tea.Msg { - return nextFieldMsg{} + return NextFieldMsg{} } // PrevField is the command to move to the previous field. func PrevField() tea.Msg { - return prevFieldMsg{} + return PrevFieldMsg{} } // Init initializes the group. @@ -260,7 +260,7 @@ func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) { g.selector.Set(i, m.(Field)) cmds = append(cmds, cmd) } - m, cmd := field.Update(updateFieldMsg{}) + m, cmd := field.Update(UpdateFieldMsg{}) g.selector.Set(i, m.(Field)) cmds = append(cmds, cmd) return true @@ -269,9 +269,9 @@ func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: g.WithHeight(max(g.height, min(g.fullHeight(), msg.Height-1))) - case nextFieldMsg: + case NextFieldMsg: cmds = append(cmds, g.nextField()...) - case prevFieldMsg: + case PrevFieldMsg: cmds = append(cmds, g.prevField()...) }