mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
chore: tidy
This commit is contained in:
+10
-4
@@ -138,11 +138,18 @@ func (m *Model) SetStyles(s Styles) {
|
|||||||
m.table.BorderHeader(s.BorderHeader)
|
m.table.BorderHeader(s.BorderHeader)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO make this able to be set with same no args as lipgloss.BorderForeground
|
||||||
|
func (m *Model) SetBorder(top, right, bottom, left bool) {
|
||||||
|
m.table.
|
||||||
|
BorderTop(top).
|
||||||
|
BorderRight(right).
|
||||||
|
BorderBottom(bottom).
|
||||||
|
BorderLeft(left)
|
||||||
|
}
|
||||||
|
|
||||||
// Option is used to set options in New. For example:
|
// Option is used to set options in New. For example:
|
||||||
//
|
//
|
||||||
// TODO change this to WithRows as the example instead
|
// table := New(WithRows([]Row{{"Foo"},{"Bar"},{"Baz"},}))
|
||||||
//
|
|
||||||
// table := New(WithColumns([]Column{{Title: "ID", Width: 10}}))
|
|
||||||
type Option func(*Model)
|
type Option func(*Model)
|
||||||
|
|
||||||
// New creates a new model for the table widget.
|
// New creates a new model for the table widget.
|
||||||
@@ -320,7 +327,6 @@ func (m *Model) SetRows(r []Row) {
|
|||||||
// TODO should we just deprecate the Row type altogether?
|
// TODO should we just deprecate the Row type altogether?
|
||||||
rows := rowToString(r)
|
rows := rowToString(r)
|
||||||
m.rows = rows
|
m.rows = rows
|
||||||
// TODO test this
|
|
||||||
m.table.ClearRows()
|
m.table.ClearRows()
|
||||||
m.table.Rows(rows...)
|
m.table.Rows(rows...)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -150,8 +150,9 @@ func TestTableAlignment(t *testing.T) {
|
|||||||
WithStyles(s),
|
WithStyles(s),
|
||||||
)
|
)
|
||||||
|
|
||||||
// unset borders for styling
|
// unset borders
|
||||||
// TODO maybe do this in View or something instead if border type is hidden?
|
// TODO I may need to expose this table OR have a helper func, they
|
||||||
|
// won't be able to do this outside of the library
|
||||||
biscuits.table.
|
biscuits.table.
|
||||||
BorderTop(false).
|
BorderTop(false).
|
||||||
BorderBottom(false).
|
BorderBottom(false).
|
||||||
|
|||||||
Reference in New Issue
Block a user