feat(table): Bring back Height and Rows

This commit is contained in:
bashbunni
2024-09-25 12:40:44 -07:00
parent e7821ead32
commit 48eb859f21
+11
View File
@@ -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