mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-18 16:38:56 +03:00
Compare commits
4 Commits
list-lint-
...
v0.12.0
Author | SHA1 | Date | |
---|---|---|---|
|
42f85b4a1b | ||
|
4d0a0ea9d8 | ||
|
658a4febc7 | ||
|
93e464296e |
@@ -66,7 +66,7 @@ Supports "dot-style" pagination (similar to what you might see on iOS) and
|
||||
numeric page numbering, but you could also just use this component for the
|
||||
logic and visualize pagination however you like.
|
||||
|
||||
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/pager/main.go)
|
||||
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/paginator/main.go)
|
||||
|
||||
|
||||
## Viewport
|
||||
|
10
list/list.go
10
list/list.go
@@ -291,19 +291,19 @@ func (m Model) ShowStatusBar() bool {
|
||||
return m.showStatusBar
|
||||
}
|
||||
|
||||
// SetStatusBarItemName defines a replacement for the items identifier. Defaults
|
||||
// to item/items
|
||||
// SetStatusBarItemName defines a replacement for the items identifier.
|
||||
// Defaults to item/items.
|
||||
func (m *Model) SetStatusBarItemName(singular, plural string) {
|
||||
m.itemNameSingular = singular
|
||||
m.itemNamePlural = plural
|
||||
}
|
||||
|
||||
// StatusBarItemName returns singular and plural status bar item names
|
||||
// StatusBarItemName returns singular and plural status bar item names.
|
||||
func (m Model) StatusBarItemName() (string, string) {
|
||||
return m.itemNameSingular, m.itemNamePlural
|
||||
}
|
||||
|
||||
// ShowingPagination hides or shoes the paginator. Note that pagination will
|
||||
// SetShowPagination hides or shoes the paginator. Note that pagination will
|
||||
// still be active, it simply won't be displayed.
|
||||
func (m *Model) SetShowPagination(v bool) {
|
||||
m.showPagination = v
|
||||
@@ -569,7 +569,7 @@ func (m *Model) StopSpinner() {
|
||||
m.showSpinner = false
|
||||
}
|
||||
|
||||
// Helper for disabling the keybindings used for quitting, incase you want to
|
||||
// Helper for disabling the keybindings used for quitting, in case you want to
|
||||
// handle this elsewhere in your application.
|
||||
func (m *Model) DisableQuitKeybindings() {
|
||||
m.disableQuitKeybindings = true
|
||||
|
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
// Internal ID management for text inputs. Necessary for blink integrity when
|
||||
// multiple text inputs are involved.
|
||||
// Internal ID management. Used during animating to ensure that frame messages
|
||||
// are received only by spinner components that sent them.
|
||||
var (
|
||||
lastID int
|
||||
idMtx sync.Mutex
|
||||
@@ -67,6 +67,22 @@ var (
|
||||
Frames: []string{"🙈", "🙉", "🙊"},
|
||||
FPS: time.Second / 3, //nolint:gomnd
|
||||
}
|
||||
Meter = Spinner{
|
||||
Frames: []string{
|
||||
"▱▱▱",
|
||||
"▰▱▱",
|
||||
"▰▰▱",
|
||||
"▰▰▰",
|
||||
"▰▰▱",
|
||||
"▰▱▱",
|
||||
"▱▱▱",
|
||||
},
|
||||
FPS: time.Second / 7, //nolint:gomnd
|
||||
}
|
||||
Hamburger = Spinner{
|
||||
Frames: []string{"☱", "☲", "☴", "☲"},
|
||||
FPS: time.Second / 3, //nolint:gomnd
|
||||
}
|
||||
)
|
||||
|
||||
// Model contains the state for the spinner. Use NewModel to create new models
|
||||
|
Reference in New Issue
Block a user