Documentation
¶
Overview ¶
Package sortmenu provides a popup sort column selector for table views. Follows the actionmenu pattern: renders as centered overlay with hotkey selection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SortColumn ¶
type SortColumn struct {
Label string // Display text (column title)
ColIndex int // Index into visible columns (for sorting Row.Data)
}
SortColumn represents a sortable column entry in the menu.
type SortMenu ¶
type SortMenu struct {
// contains filtered or unexported fields
}
SortMenu is the popup sort column selector.
func New ¶
func New(columns []SortColumn, activeColIndex int, activeAsc bool) *SortMenu
New creates a new sort menu from a list of sortable columns. activeColIndex is the currently sorted column (-1 for none).
func (*SortMenu) GetColumns ¶
func (m *SortMenu) GetColumns() []SortColumn
GetColumns returns the columns (for testing).
type SortMenuClosedMsg ¶
type SortMenuClosedMsg struct{}
SortMenuClosedMsg is emitted when the menu is closed without selection.
type SortSelectedMsg ¶
SortSelectedMsg is emitted when a sort column is selected.
type Styles ¶
type Styles struct {
Container lipgloss.Style
Title lipgloss.Style
Key lipgloss.Style
KeySelected lipgloss.Style
Label lipgloss.Style
LabelSelected lipgloss.Style
Indicator lipgloss.Style
Divider lipgloss.Style
Help lipgloss.Style
}
Styles holds sort menu styles.
func DefaultStyles ¶
func DefaultStyles() Styles
DefaultStyles returns the default sort menu styles.