Documentation
      ¶
    
    
  
    
  
    Index ¶
- func NewFilterTable(title string, cols Columns, rows []Row, styles FilterTableStyles, ...) tea.Model
 - func NewTable(title string, cols Columns, rows []Row, styles Styles, keymap KeyMap) tea.Model
 - func StringStyler(styles map[string]lipgloss.Style) func(string) string
 - type CellStyle
 - type Column
 - type Columns
 - type FilterKeyMap
 - type FilterStateChangeMsg
 - type FilterStyles
 - type FilterTable
 - type FilterTableKeyMap
 - type FilterTableStyles
 - type KeyMap
 - type Row
 - type RowChangedMsg
 - type SetRowsMsg
 - type SetSizeMsg
 - type SetTitleMsg
 - type Styles
 - type Table
 - type UserData
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFilterTable ¶
func NewFilterTable(title string, cols Columns, rows []Row, styles FilterTableStyles, keymap FilterTableKeyMap) tea.Model
Types ¶
type CellStyle ¶
type CellStyle struct {
	// Style is the style for the cell.
	Style lipgloss.Style
	// Format is a printf-style format string for the cell value.
	// If not specified, the default format is "%v".
	Format string
}
    CellStyle specifies a customized style for a cell in a column, overriding the table's Cell and Selected styles.
NOTE: Table renders the row by taking this style and inheriting from the table's Selected/Cell style, Any style attributes from the base Style are overridden if also specified in Selected/Cell style. This may result in unexpected behavior. E.g., if the base Style has a background color, but the base style has a black background, then the column's row will have a black background, which is probably not what you want.
type Column ¶
type Column struct {
	// RowStyle overrides the style for row cells in this column, as specified in Styles.Selected and Styles.Cell.
	//
	// NOTE: Table renders the row by taking this style and inheriting from the table's Selected/Cell style,
	// Any style attributes from the base Style are overridden if also specified in Selected/Cell style.
	// This may result in unexpected behavior. E.g., if the base Style has a background color,
	// but the base style has a black background, then the column's row will have a black background,
	// which is probably not what you want.
	RowStyle CellStyle
	// Name of the column.
	Name string
	// Width <= 0 indicates flexible (auto) width to be computed from available space.
	Width int
}
    Column specifies a column in the table (the name and width), as well as an optional CellStyle to override the table's Cell and Selected styles.
type FilterKeyMap ¶
func DefaultFilterKeyMap ¶
func DefaultFilterKeyMap() FilterKeyMap
func (FilterKeyMap) FullHelp ¶
func (f FilterKeyMap) FullHelp() [][]key.Binding
func (FilterKeyMap) ShortHelp ¶
func (f FilterKeyMap) ShortHelp() []key.Binding
type FilterStateChangeMsg ¶ added in v0.5.0
type FilterStateChangeMsg struct {
	State bool
}
    FilterStateChangeMsg is sent when the filter is switched on or off. State indicates the new state.
type FilterStyles ¶
type FilterTable ¶
type FilterTable struct {
	// contains filtered or unexported fields
}
    func (FilterTable) Init ¶
func (f FilterTable) Init() tea.Cmd
func (FilterTable) View ¶
func (f FilterTable) View() string
type FilterTableKeyMap ¶
type FilterTableKeyMap struct {
	TableKeyMap  KeyMap
	FilterKeyMap FilterKeyMap
}
    func DefaultFilterTableKeyMap ¶
func DefaultFilterTableKeyMap() FilterTableKeyMap
func (FilterTableKeyMap) FullHelp ¶
func (f FilterTableKeyMap) FullHelp() [][]key.Binding
func (FilterTableKeyMap) ShortHelp ¶
func (f FilterTableKeyMap) ShortHelp() []key.Binding
type FilterTableStyles ¶
type FilterTableStyles struct {
	Table  Styles
	Filter FilterStyles
}
    type KeyMap ¶
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
type RowChangedMsg ¶ added in v0.5.0
RowChangedMsg is sent when the selected row changes.
type SetSizeMsg ¶
SetSizeMsg sets the size of the table (including any border requested by styles
type SetTitleMsg ¶
type SetTitleMsg struct {
	Title string
}
    SetTitleMsg sets the title of the table.