Documentation ¶
Overview ¶
forked from: https://github.com/charmbracelet/bubbles/blob/master/paginator/paginator.go
Index ¶
- func OpenBrowser(url string)
- type Bubble
- type Bubbles
- type ErrorMsg
- type Nav
- type Paginator
- func (m Paginator) GetContent() string
- func (m *Paginator) GetCursorIndex() int
- func (m *Paginator) GetSliceBounds() (start int, end int)
- func (m *Paginator) GetSliceStart() int
- func (m *Paginator) GoToStart()
- func (m Paginator) ItemsOnPage() int
- func (m *Paginator) LineDown()
- func (m *Paginator) LineUp()
- func (m *Paginator) NextPage()
- func (m Paginator) OnLastPage() bool
- func (m *Paginator) PrevPage()
- func (m *Paginator) SetContent(s string)
- func (m *Paginator) SetHeight(i int)
- func (m *Paginator) SetTotalPages(items int) int
- func (m *Paginator) SetWidth(i int)
- func (m Paginator) Update(msg tea.Msg) (Paginator, tea.Cmd)
- func (m Paginator) View() string
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenBrowser ¶
func OpenBrowser(url string)
Types ¶
type Bubble ¶
type Bubble struct {
// contains filtered or unexported fields
}
func InitialModel ¶
func InitialModel() Bubble
type Paginator ¶
type Paginator struct { Type Type Cursor int Index int Page int PerPage int TotalPages int Width int Height int ActiveDot string InactiveDot string Content string }
Paginator is the Bubble Tea model for this user interface.
func NewPaginator ¶
func NewPaginator() Paginator
func (Paginator) GetContent ¶
func (*Paginator) GetCursorIndex ¶
func (*Paginator) GetSliceBounds ¶
func (*Paginator) GetSliceStart ¶
func (Paginator) ItemsOnPage ¶
ItemsOnPage is a helper function for returning the numer of items on the current page given the total numer of items passed as an argument.
func (*Paginator) NextPage ¶
func (m *Paginator) NextPage()
NextPage is a helper function for navigating one page forward. It will not page beyond the last page (i.e. totalPages - 1).
func (Paginator) OnLastPage ¶
OnLastPage returns whether or not we're on the last page.
func (*Paginator) PrevPage ¶
func (m *Paginator) PrevPage()
PrevPage is a number function for navigating one page backward. It will not page beyond the first page (i.e. page 0).
func (*Paginator) SetContent ¶
SetContent set the pager's text content.
func (*Paginator) SetTotalPages ¶
SetTotalPages is a helper function for calculating the total number of pages from a given number of items. It's use is optional since this pager can be used for other things beyond navigating sets. Note that it both returns the number of total pages and alters the model.