Documentation
¶
Index ¶
- Constants
- Variables
- type ActionBarModel
- func (m *ActionBarModel) Blur() *ActionBarModel
- func (m *ActionBarModel) Focus() *ActionBarModel
- func (m ActionBarModel) GetActions() (output []con.Action)
- func (m ActionBarModel) GetInputValue() string
- func (m *ActionBarModel) HandleShortcuts(shortcut string) *ActionBarModel
- func (m ActionBarModel) Init() tea.Cmd
- func (m *ActionBarModel) SetActionDelegate(delegate func() []con.Action) *ActionBarModel
- func (m *ActionBarModel) SetInput(input textinput.Model) *ActionBarModel
- func (m *ActionBarModel) ToggleFocus() *ActionBarModel
- func (m ActionBarModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m ActionBarModel) View() string
- type ActionListModel
- func (m *ActionListModel) Blur() *ActionListModel
- func (m *ActionListModel) Focus() *ActionListModel
- func (m ActionListModel) Focused() bool
- func (m ActionListModel) GetCurrentSuggestions() (output []con.Action)
- func (m ActionListModel) GetFocusedSuggestion() *con.Action
- func (m *ActionListModel) GetInput() string
- func (m ActionListModel) Init() tea.Cmd
- func (m *ActionListModel) SetInput(input string) *ActionListModel
- func (m ActionListModel) Update(msg tea.Msg) (ActionListModel, tea.Cmd)
- func (m *ActionListModel) UpdateSuggestedActions() (output *ActionListModel)
- func (m *ActionListModel) UpdateSuggestedActionsFromInput(input string) (output *ActionListModel)
- func (m ActionListModel) View() string
Constants ¶
const ( NO_FOCUS_INDEX = -1 COLUMN_WIDTH = 30 )
Variables ¶
var DEFAULT_TABLE_STYLE = lipgloss.HiddenBorder()
Functions ¶
This section is empty.
Types ¶
type ActionBarModel ¶
type ActionBarModel struct {
// contains filtered or unexported fields
}
A TUI element that allows users to type action names into a text input in order to search for and execute actions
func NewActionBarModel ¶
func NewActionBarModel(actionsDelegate func() []con.Action) *ActionBarModel
Instantiates a new ActionBarModel with default settings
func (*ActionBarModel) Blur ¶
func (m *ActionBarModel) Blur() *ActionBarModel
Blurs the ActionBarModel's input
func (*ActionBarModel) Focus ¶
func (m *ActionBarModel) Focus() *ActionBarModel
Unblurs the ActionBarModel's input
func (ActionBarModel) GetActions ¶
func (m ActionBarModel) GetActions() (output []con.Action)
Calls the ActionBarModel.actionsDelegate to get a list of all actions
func (ActionBarModel) GetInputValue ¶
func (m ActionBarModel) GetInputValue() string
Returns the current value of the textinput.Model
func (*ActionBarModel) HandleShortcuts ¶
func (m *ActionBarModel) HandleShortcuts(shortcut string) *ActionBarModel
Handles the given keyboard shortcut string, whether it's an action's shortcut or a shortcut for the action bar itself
func (ActionBarModel) Init ¶
func (m ActionBarModel) Init() tea.Cmd
Initializes the ActionBarModel's text input
func (*ActionBarModel) SetActionDelegate ¶
func (m *ActionBarModel) SetActionDelegate(delegate func() []con.Action) *ActionBarModel
Sets the function used by ActionBarModel to get the list of available actions
func (*ActionBarModel) SetInput ¶
func (m *ActionBarModel) SetInput(input textinput.Model) *ActionBarModel
Sets the model for the ActionBarModel's text input
func (*ActionBarModel) ToggleFocus ¶
func (m *ActionBarModel) ToggleFocus() *ActionBarModel
Switches the focused/blured state of the ActionBarModel's input
func (ActionBarModel) View ¶
func (m ActionBarModel) View() string
type ActionListModel ¶
type ActionListModel struct {
// contains filtered or unexported fields
}
Handles displaying a list of action suggestions to the user
func NewActionListModel ¶
func NewActionListModel(actions func(string) []con.Action) ActionListModel
Instantiates an ActionListModel with default values
func (*ActionListModel) Blur ¶
func (m *ActionListModel) Blur() *ActionListModel
Unfocuses the suggestion list
func (*ActionListModel) Focus ¶
func (m *ActionListModel) Focus() *ActionListModel
Focuses the first suggested action
func (ActionListModel) Focused ¶
func (m ActionListModel) Focused() bool
Returns whether any of the suggestions in the list are focused
func (ActionListModel) GetCurrentSuggestions ¶
func (m ActionListModel) GetCurrentSuggestions() (output []con.Action)
func (ActionListModel) GetFocusedSuggestion ¶
func (m ActionListModel) GetFocusedSuggestion() *con.Action
Returns the currently focused sugggested action, or nil if blurred
func (*ActionListModel) GetInput ¶
func (m *ActionListModel) GetInput() string
func (ActionListModel) Init ¶
func (m ActionListModel) Init() tea.Cmd
func (*ActionListModel) SetInput ¶
func (m *ActionListModel) SetInput(input string) *ActionListModel
Sets the input value being used to filter suggestions
func (ActionListModel) Update ¶
func (m ActionListModel) Update(msg tea.Msg) (ActionListModel, tea.Cmd)
func (*ActionListModel) UpdateSuggestedActions ¶
func (m *ActionListModel) UpdateSuggestedActions() (output *ActionListModel)
Calls the ActionListModel's actionsDelegate and sets the currentSuggestions to the result
func (*ActionListModel) UpdateSuggestedActionsFromInput ¶
func (m *ActionListModel) UpdateSuggestedActionsFromInput(input string) (output *ActionListModel)
Sets the input value to a given string and updates the suggested actions
func (ActionListModel) View ¶
func (m ActionListModel) View() string