panel

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details added in v0.3.0

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

Details handles the panel for showing the command details.

func NewDetails added in v0.3.0

func NewDetails(logger *slog.Logger) Details

NewDetails returns a new DetailsPanel.

func (*Details) SetCommand added in v0.3.0

func (p *Details) SetCommand(cmd command.Command) error

SetCommand sets the command to view in the panel.

func (*Details) SetSize added in v0.3.0

func (p *Details) SetSize(width, height int)

SetSize sets the details panel size

func (*Details) ToggleConfirmation added in v0.3.0

func (p *Details) ToggleConfirmation() tea.Cmd

ToggleConfirmation toggles the confirmation mode

func (*Details) Update added in v0.3.0

func (p *Details) Update(msg tea.Msg) (Details, tea.Cmd)

Update handles the msgs.

func (*Details) View added in v0.3.0

func (p *Details) View() string

View renders the DetailsPanel view.

type Edit added in v0.3.0

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

Edit handles the panel for editing or creating a command.

func NewEdit added in v0.3.0

func NewEdit(keys ckey.Map, logger *slog.Logger) Edit

NewEdit returns a new ExecutePanel.

func (*Edit) FullHelp added in v0.3.0

func (p *Edit) FullHelp() [][]key.Binding

func (*Edit) Init added in v0.3.0

func (p *Edit) Init() tea.Cmd

Init starts the input blink

func (*Edit) Reset added in v0.3.0

func (p *Edit) Reset()

func (*Edit) SetCommand added in v0.3.0

func (p *Edit) SetCommand(mode EditMode, cmd *command.Command) error

SetCommand sets the panel content.

func (*Edit) SetSize added in v0.3.0

func (p *Edit) SetSize(width, height int)

SetSize sets the panel size.

func (*Edit) ShortHelp added in v0.3.0

func (p *Edit) ShortHelp() []key.Binding

func (*Edit) Update added in v0.3.0

func (p *Edit) Update(msg tea.Msg) (Edit, tea.Cmd)

Update handles the msgs.

func (*Edit) View added in v0.3.0

func (p *Edit) View() string

View returns the string representation of the panel.

type EditMode added in v0.3.0

type EditMode int

EditMode represents the way the panel is going to be used.

const (

	// NewCommandMode pannel is going to return a new Command
	NewCommandMode EditMode
	// EditCommandMode pannel is going to return the passed Command updated.
	EditCommandMode
)

type Execute added in v0.3.0

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

Execute handles the panel for executing a command.

func NewExecute added in v0.3.0

func NewExecute(keys ckey.Map, logger *slog.Logger) Execute

NewExecute returns a new ExecutePanel.

func (*Execute) FullHelp added in v0.3.0

func (p *Execute) FullHelp() [][]key.Binding

func (*Execute) Init added in v0.3.0

func (p *Execute) Init() tea.Cmd

Init starts the input blink

func (*Execute) SetCommand added in v0.3.0

func (p *Execute) SetCommand(cmd command.Command) error

SetCommand sets the panel content.

func (*Execute) SetSize added in v0.3.0

func (p *Execute) SetSize(width, height int)

SetSize sets the panel size.

func (*Execute) ShortHelp added in v0.3.0

func (p *Execute) ShortHelp() []key.Binding

func (*Execute) Update added in v0.3.0

func (p *Execute) Update(msg tea.Msg) (Execute, tea.Cmd)

Update handles the msgs.

func (*Execute) View added in v0.3.0

func (p *Execute) View() string

View returns the string representation of the panel.

type Explain added in v0.3.0

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

Explain handles the panel for explaing the command

func NewExplain added in v0.3.0

func NewExplain(keys ckey.Map, logger *slog.Logger) Explain

func (*Explain) FullHelp added in v0.3.0

func (p *Explain) FullHelp() [][]key.Binding

func (*Explain) Init added in v0.3.0

func (p *Explain) Init() tea.Cmd

func (*Explain) SetCommand added in v0.3.0

func (p *Explain) SetCommand(cmd command.Command) error

func (*Explain) SetExplanation added in v0.3.0

func (p *Explain) SetExplanation(explanation string) error

func (*Explain) SetSize added in v0.3.0

func (p *Explain) SetSize(width, height int)

func (*Explain) ShortHelp added in v0.3.0

func (p *Explain) ShortHelp() []key.Binding

func (*Explain) Update added in v0.3.0

func (p *Explain) Update(msg tea.Msg) (Explain, tea.Cmd)

func (*Explain) View added in v0.3.0

func (p *Explain) View() string

type Explorer added in v0.3.0

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

Explorer handles the panel for listing the commands.

func NewExplorer added in v0.3.0

func NewExplorer(keys ckey.Map) Explorer

NewExplorer returns a new ExplorerView.

func (*Explorer) AddCommand added in v0.3.0

func (p *Explorer) AddCommand(cmd command.Command) int

AddCommand adds a new item to the List

func (*Explorer) FullHelp added in v0.3.0

func (p *Explorer) FullHelp() [][]key.Binding

func (*Explorer) RefreshCommand added in v0.3.0

func (p *Explorer) RefreshCommand(cmd command.Command)

RefreshCommand refresh the item command of the selected Item.

func (*Explorer) RemoveSelectedCommand added in v0.3.0

func (p *Explorer) RemoveSelectedCommand() int

RemoveSelectedCommand removes the selected item form the list.

func (*Explorer) Select added in v0.3.0

func (p *Explorer) Select(idx int)

Select selects the element in the provided index.

func (*Explorer) SelectedCommand added in v0.3.0

func (p *Explorer) SelectedCommand() (*ExplorerItem, bool)

SelectedCommand returns the ExplorerItem selected. Returns false if item not found or of incorrect type.

func (*Explorer) SetCommands added in v0.3.0

func (p *Explorer) SetCommands(cmds []command.Command)

SetCommands sets the content of the list.

func (*Explorer) SetSize added in v0.3.0

func (p *Explorer) SetSize(w, h int)

SetSize sets the size the panel.

func (*Explorer) ShortHelp added in v0.3.0

func (p *Explorer) ShortHelp() []key.Binding

func (*Explorer) Update added in v0.3.0

func (p *Explorer) Update(msg tea.Msg) (Explorer, tea.Cmd)

Update handles the msgs.

func (Explorer) View added in v0.3.0

func (p Explorer) View() string

View returns the string representation of the panel.

type ExplorerItem

type ExplorerItem struct {

	// Command is a pointer to the represented command.
	Command *command.Command
	// Loaded indicates if the inner command has been fully loaded.
	Loaded bool
	// contains filtered or unexported fields
}

ExplorerItem is the explorer items

func (ExplorerItem) Description

func (i ExplorerItem) Description() string

func (ExplorerItem) FilterValue

func (i ExplorerItem) FilterValue() string

func (ExplorerItem) Title

func (i ExplorerItem) Title() string
type Search struct {
	// contains filtered or unexported fields
}

func NewSearch added in v0.3.0

func NewSearch(keys ckey.Map, logger *slog.Logger) Search

func (*Search) Content added in v0.3.0

func (p *Search) Content() string

func (*Search) Focus added in v0.3.0

func (p *Search) Focus()

func (*Search) FullHelp added in v0.3.0

func (p *Search) FullHelp() [][]key.Binding

func (*Search) Init added in v0.3.0

func (p *Search) Init() tea.Cmd

Init starts the input blink

func (*Search) Reset added in v0.3.0

func (p *Search) Reset()

func (*Search) SetWidth added in v0.3.0

func (p *Search) SetWidth(width int)

func (*Search) ShortHelp added in v0.3.0

func (p *Search) ShortHelp() []key.Binding

func (*Search) Unfocus added in v0.3.0

func (p *Search) Unfocus()

func (*Search) Update added in v0.3.0

func (p *Search) Update(msg tea.Msg) (Search, tea.Cmd)

func (*Search) View added in v0.3.0

func (p *Search) View() string

Jump to

Keyboard shortcuts

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