teacozy

package module
v0.0.61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 18 Imported by: 1

README

teacozy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeyMap

func DefaultKeyMap() keys.KeyMap

func Filter

func Filter(search string, choices item.Choices) []item.Item

Types

type App

type App struct {
	reactea.BasicComponent
	reactea.BasicPropfulComponent[reactea.NoProps]

	Style

	// How long status messages should stay visible. By default this is
	// 1 second.
	StatusMessageLifetime time.Duration

	Choices item.Choices
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*App, error)

func (*App) AfterUpdate

func (m *App) AfterUpdate() tea.Cmd

func (App) Chosen

func (m App) Chosen() []map[string]string

func (*App) ClearSelections

func (c *App) ClearSelections() tea.Cmd

func (App) CurrentItem

func (m App) CurrentItem() item.Choice

func (App) FilterValue

func (c App) FilterValue() string

func (App) Height

func (c App) Height() int

func (*App) Init

func (c *App) Init(reactea.NoProps) tea.Cmd

func (App) InputValue

func (c App) InputValue() string

func (App) Limit

func (c App) Limit() int

func (*App) NewStatusMessage

func (m *App) NewStatusMessage(s string) tea.Cmd

NewStatusMessage sets a new status message, which will show for a limited amount of time. Note that this also returns a command.

func (*App) Render

func (c *App) Render(width, height int) string

func (*App) ResetFilter

func (c *App) ResetFilter()

func (*App) ResetInput

func (c *App) ResetInput()

func (App) Selections

func (m App) Selections() []int

func (*App) SetFilter

func (c *App) SetFilter(s string)

func (*App) SetFooter

func (c *App) SetFooter(h string) *App

func (*App) SetInput

func (c *App) SetInput(value string)

func (*App) SetLimit

func (c *App) SetLimit(l int) *App

func (*App) SetStatus

func (c *App) SetStatus(h string) *App

func (*App) SetTitle

func (c *App) SetTitle(h string) *App

func (*App) ToggleItems

func (m *App) ToggleItems(items ...int)

func (*App) Update

func (c *App) Update(msg tea.Msg) tea.Cmd

func (App) Width

func (c App) Width() int

type Option

type Option func(*App)

func ConfirmChoices

func ConfirmChoices() Option

func Editable

func Editable() Option

func NoLimit

func NoLimit() Option

func WithFilter

func WithFilter() Option

func WithLimit

func WithLimit(l int) Option

func WithMap

func WithMap(c []map[string]string) Option

func WithSlice

func WithSlice[E any](c []E) Option

func WithTitle

func WithTitle(t string) Option

type Style

type Style struct {
	Confirm lipgloss.Style
	Footer  lipgloss.Style
	Header  lipgloss.Style
	Status  lipgloss.Style
}

func DefaultStyle

func DefaultStyle() Style

Directories

Path Synopsis
Code generated by gomplate -f _gen/color.tmpl -o gen_color.go -c .=_gen/color.toml; Do Not Edit
Code generated by gomplate -f _gen/color.tmpl -o gen_color.go -c .=_gen/color.toml; Do Not Edit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL