Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MaxColumnWidth caps how wide a non-rank column can be. MaxColumnWidth = 30 // MinTableHeightRows ensures the viewport is never too small to render properly. MinTableHeightRows = 2 )
Variables ¶
View Source
var ( // ErrNoItems indicates there were no items to select from. ErrNoItems = eris.New("no items to select from") )
Functions ¶
Types ¶
type Model ¶
type Model struct {
Prompt string
Columns []string // excludes the blank rank column
Rows [][]string // excludes the rank cell; rank is auto-generated
Cursor int
NumericBuf string
Ctx context.Context
Aborted bool
// contains filtered or unexported fields
}
Model represents the UI state for numeric selection with a table and prompt.
func InitialModel ¶
func InitialModel(ctx context.Context, prompt string, columns []string, rows [][]string, defaultIndex int) *Model
InitialModel creates a new Model with the given columns, rows, context and default cursor.
Click to show internal directories.
Click to hide internal directories.