mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 12:46:14 +00:00
feat(table): Bring back Height and Rows
This commit is contained in:
@@ -421,6 +421,12 @@ func (m *Model) SetRows(r []Row) {
|
||||
m.table.Rows(rows...)
|
||||
}
|
||||
|
||||
// Rows returns the rows set for the table.
|
||||
// TODO do we need this? We used to have m.rows public...
|
||||
func (m Model) Rows() [][]string {
|
||||
return m.rows
|
||||
}
|
||||
|
||||
// rowToString helper to unwrap the Row type.
|
||||
func rowToString(rows []Row) [][]string {
|
||||
var out [][]string
|
||||
@@ -451,6 +457,11 @@ func (m *Model) SetHeight(h int) {
|
||||
m.table.Height(h)
|
||||
}
|
||||
|
||||
// Height returns the height of the table, including borders.
|
||||
func (m Model) Height() int {
|
||||
return m.height
|
||||
}
|
||||
|
||||
// Cursor returns the index of the selected row.
|
||||
func (m Model) Cursor() int {
|
||||
return m.cursor
|
||||
|
||||
Reference in New Issue
Block a user