Documentation
¶
Index ¶
- Variables
- type AgoColumn
- type JoinedColumn
- type KeyMap
- type Model
- func (m *Model) AddRow(row Row) tea.Cmd
- func (m Model) FullHelp() [][]key.Binding
- func (m Model) Init() tea.Cmd
- func (m *Model) RowIndex(id string) int
- func (m *Model) SetError(err error)
- func (m *Model) SetHeaders(headers []string)
- func (m *Model) SetRows(rows []Row) tea.Cmd
- func (m *Model) StartSpinner() tea.Cmd
- func (m *Model) StopSpinner()
- func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type Row
- type RowStyles
- type Status
- type StyledColumn
- type Styles
- type TickMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultKeyMap = KeyMap{ PrevPage: key.NewBinding( key.WithKeys("left", "h", "pgup"), key.WithHelp("←/h/pgup", "prev page"), ), NextPage: key.NewBinding( key.WithKeys("right", "l", "pgdown"), key.WithHelp("→/l/pgdn", "next page"), ), GoToStart: key.NewBinding( key.WithKeys("home", "g"), key.WithHelp("g/home", "go to start"), ), GoToEnd: key.NewBinding( key.WithKeys("end", "G"), key.WithHelp("G/end", "go to end"), ), ToggleFullscreen: key.NewBinding( key.WithKeys("f"), key.WithHelp("f", "toggle fullscreen"), ), ToggleDeleted: key.NewBinding( key.WithKeys("d"), key.WithHelp("d", "show/hide deleted"), ), Filter: key.NewBinding( key.WithKeys("/"), key.WithHelp("/", "filter by text"), ), CloseFilter: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "close the filter input field"), ), ClearFilter: key.NewBinding( key.WithKeys("esc"), key.WithHelp("esc", "clear the applied filter"), ), NextSuggestion: key.NewBinding( key.WithKeys("down", "ctrl+n"), key.WithHelp("↓/ctrl+n", "show next suggestion"), ), PrevSuggestion: key.NewBinding( key.WithKeys("up", "ctrl+p"), key.WithHelp("↑/ctrl+p", "show previous suggestion"), ), AcceptSuggestion: key.NewBinding( key.WithKeys("tab"), key.WithHelp("tab", "accept a suggestion"), ), ShowFullHelp: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "more"), ), CloseFullHelp: key.NewBinding( key.WithKeys("?", "esc"), key.WithHelp("?/esc", "close help"), ), ForceQuit: key.NewBinding( key.WithKeys("ctrl+c"), key.WithHelp("ctrl+c", "quit"), ), }
DefaultKeyMap is a default set of keybindings.
View Source
var DefaultRowStyle = RowStyles{ Cell: lipgloss.NewStyle(), Error: lipgloss.NewStyle().Foreground(lipgloss.Color("1")), Deleted: lipgloss.NewStyle().Foreground(lipgloss.Color("8")), }
View Source
var DefaultStyles = Styles{ TitleBar: lipgloss.NewStyle(), Title: lipgloss.NewStyle(), Row: DefaultRowStyle, NoneFound: lipgloss.NewStyle(). Foreground(lipgloss.ANSIColor(3)). SetString("No resources found"), Error: lipgloss.NewStyle(). Foreground(lipgloss.ANSIColor(9)). SetString("ERROR:"), Pagination: lipgloss.NewStyle(). Foreground(subduedColor). SetString("PAGE:"), FilterPrompt: lipgloss.NewStyle(). Foreground(lipgloss.ANSIColor(11)). SetString("FILTER:"), FilterInfo: lipgloss.NewStyle(). Foreground(subduedColor). SetString("FILTERING:"), FilterNoneVisible: lipgloss.NewStyle(). Foreground(lipgloss.ANSIColor(3)). SetString("No resources visible"), StatusDelim: lipgloss.NewStyle(). Foreground(subduedColor). Bold(true). SetString(" | "), Toggles: lipgloss.NewStyle(). Foreground(subduedColor), }
Functions ¶
This section is empty.
Types ¶
type JoinedColumn ¶ added in v0.6.0
type KeyMap ¶
type KeyMap struct { // Keybindings used when browsing the list. NextPage key.Binding PrevPage key.Binding GoToStart key.Binding GoToEnd key.Binding // Keybindings for view settings ToggleDeleted key.Binding ToggleFullscreen key.Binding // Keybindings used while the text-filter is enabled. Filter key.Binding CloseFilter key.Binding ClearFilter key.Binding NextSuggestion key.Binding PrevSuggestion key.Binding AcceptSuggestion key.Binding // Help toggle keybindings. ShowFullHelp key.Binding CloseFullHelp key.Binding // The quit-no-matter-what keybinding. This will be caught when filtering. ForceQuit key.Binding }
KeyMap defines keybindings. It satisfies to the help.KeyMap interface, which is used to render the menu.
type Model ¶
type Model struct { Styles Styles CellSpacing int HideDeleted bool ShowHelp bool // Key mappings for navigating the list. KeyMap KeyMap Paginator paginator.Model // contains filtered or unexported fields }
func (Model) FullHelp ¶
FullHelp returns bindings to show the full help view. It's part of the help.KeyMap interface.
func (*Model) SetHeaders ¶
func (*Model) StartSpinner ¶
func (*Model) StopSpinner ¶
func (m *Model) StopSpinner()
type Row ¶
type Row struct { ID string Fields []any Status Status SortKey string Suggestion string // contains filtered or unexported fields }
func (*Row) ReRenderFields ¶
func (r *Row) ReRenderFields()
func (*Row) RenderedFields ¶
type StyledColumn ¶
Click to show internal directories.
Click to hide internal directories.