Documentation
¶
Index ¶
- type Column
- type KeyMap
- type Model
- func (m *Model) Blur() tea.Cmd
- func (m Model) Cell() (any, error)
- func (m Model) Cursor() (int, int)
- func (m *Model) Focus() tea.Cmd
- func (m Model) Focused() bool
- func (m *Model) GotoBottom()
- func (m *Model) GotoTop()
- func (m Model) Height() int
- func (m Model) ID() uuid.UUID
- func (m Model) Init() tea.Cmd
- func (m Model) KeyBindings() []key.Binding
- func (m *Model) MoveDown(n int)
- func (m *Model) MoveLeft()
- func (m *Model) MoveRight()
- func (m *Model) MoveUp(n int)
- func (m *Model) PageDown()
- func (m *Model) PageUp()
- func (m *Model) SetCell(cell any)
- func (m *Model) SetCursor(row, col int)
- func (m *Model) SetRows(rows []Row)
- func (m *Model) SetWindow(height, width int)
- func (m Model) Update(msg tea.Msg) (_ tea.Model, cmd tea.Cmd)
- func (m *Model) UpdateViewport()
- func (m Model) View() string
- func (m Model) Width() int
- type Row
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMap ¶
type KeyMap struct {
LineLeft key.Binding
LineRight key.Binding
LineUp key.Binding
LineDown key.Binding
PageUp key.Binding
PageDown key.Binding
GotoTop key.Binding
GotoBottom key.Binding
CellFocus key.Binding
}
KeyMap defines keybindings. It satisfies to the help.KeyMap interface, which is used to render the menu.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns a default set of keybindings.
type Model ¶
Model defines a state for the table widget.
func (*Model) Focus ¶
Focus focuses the table, allowing the user to move around the rows and interact.
func (*Model) GotoBottom ¶
func (m *Model) GotoBottom()
GotoBottom moves the selection to the last row.
func (Model) KeyBindings ¶ added in v0.0.3
func (*Model) MoveDown ¶
MoveDown moves the selection down by any number of rows. It can not go below the last row.
func (*Model) MoveLeft ¶
func (m *Model) MoveLeft()
MoveUp moves the selection up by any number of rows. It can not go above the first row.
func (*Model) MoveRight ¶
func (m *Model) MoveRight()
MoveUp moves the selection up by any number of rows. It can not go above the first row.
func (*Model) MoveUp ¶
MoveUp moves the selection up by any number of rows. It can not go above the first row.
func (*Model) UpdateViewport ¶
func (m *Model) UpdateViewport()
UpdateViewport updates the list content based on the previously defined columns and rows.
type Styles ¶
type Styles struct {
Header func() lipgloss.Style
Cell func() lipgloss.Style
CursorHeader func() lipgloss.Style
CursorRow func() lipgloss.Style
CursorColumn func(int) lipgloss.Style
Border lipgloss.Border
BorderHeader bool
BorderRow bool
BorderColumn bool
BorderTop bool
BorderBottom bool
BorderLeft bool
BorderRight bool
}
Styles contains style definitions for this list component. By default, these values are generated by DefaultStyles.
func DefaultStyles ¶
func DefaultStyles() Styles
DefaultStyles returns a set of default style definitions for this table.