From cae042849cdbb0e59b963ce8fd7d3b2ddfd4280f Mon Sep 17 00:00:00 2001 From: bashbunni Date: Wed, 25 Sep 2024 10:27:11 -0700 Subject: [PATCH] chore: tidy --- table/table.go | 14 ++++++++++---- table/table_test.go | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/table/table.go b/table/table.go index f8ce972..acda9ff 100644 --- a/table/table.go +++ b/table/table.go @@ -138,11 +138,18 @@ func (m *Model) SetStyles(s Styles) { 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: // -// TODO change this to WithRows as the example instead -// -// table := New(WithColumns([]Column{{Title: "ID", Width: 10}})) +// table := New(WithRows([]Row{{"Foo"},{"Bar"},{"Baz"},})) type Option func(*Model) // 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? rows := rowToString(r) m.rows = rows - // TODO test this m.table.ClearRows() m.table.Rows(rows...) } diff --git a/table/table_test.go b/table/table_test.go index 0b52b94..d5e27ae 100644 --- a/table/table_test.go +++ b/table/table_test.go @@ -150,8 +150,9 @@ func TestTableAlignment(t *testing.T) { WithStyles(s), ) - // unset borders for styling - // TODO maybe do this in View or something instead if border type is hidden? + // unset borders + // 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. BorderTop(false). BorderBottom(false).