selector

package
v1.0.59 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExactFilter = FilterFunc(strings.Contains)

Functions

func GetMultipleSelectedFunc

func GetMultipleSelectedFunc(model tea.Model) ([]int, error)

func GetOneSelectedFunc

func GetOneSelectedFunc(model tea.Model) (int, error)

Types

type FilterFunc

type FilterFunc func(string, string) bool

type KeyMap

type KeyMap struct {
	LineUp   key.Binding
	LineDown key.Binding
	PageUp   key.Binding
	PageDown key.Binding
	Home     key.Binding
	End      key.Binding

	Select      key.Binding
	MultiSelect key.Binding
	SelectAll   key.Binding
	DeselectAll key.Binding

	Filter      key.Binding
	FilterClear key.Binding
}

func DefaultKeymap

func DefaultKeymap() KeyMap

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(tableBody *table.Body, opts ...Option) *Model

func (*Model) Down

func (m *Model) Down(jump int)

func (*Model) End

func (m *Model) End()

func (*Model) Home

func (m *Model) Home()

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) IsMultiSelect

func (m *Model) IsMultiSelect() bool

func (*Model) Resize

func (m *Model) Resize(width, height int)

func (*Model) Select

func (m *Model) Select()

func (*Model) SelectAll

func (m *Model) SelectAll(deselect bool)

func (*Model) SelectCommand

func (m *Model) SelectCommand() tea.Msg

func (*Model) Selected

func (m *Model) Selected() []int

func (*Model) Up

func (m *Model) Up(jump int)

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

type Option

type Option = gn.Option[Model]

func WithEnableFiltering

func WithEnableFiltering() Option

func WithEnableMultiSelect

func WithEnableMultiSelect() Option

func WithFilterFunc

func WithFilterFunc(filterFunc FilterFunc) Option

func WithHeader

func WithHeader(header *table.Row) Option

func WithLabel

func WithLabel(label string) Option

func WithSetEnableFiltering

func WithSetEnableFiltering(enable bool) Option

func WithSetEnableMultiSelect

func WithSetEnableMultiSelect(enable bool) Option

type RooKeymap

type RooKeymap struct {
	Quit key.Binding
	Help key.Binding
}

func DefaultRootKeymap

func DefaultRootKeymap() RooKeymap

type RootModel

type RootModel struct {
	*Model
	// contains filtered or unexported fields
}

func NewRoot

func NewRoot(ctx context.Context, tableBody *table.Body, opts ...Option) *RootModel

func (*RootModel) Err

func (r *RootModel) Err() error

func (*RootModel) HelpView

func (r *RootModel) HelpView() string

func (*RootModel) Init

func (r *RootModel) Init() tea.Cmd

func (*RootModel) Update

func (r *RootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*RootModel) View

func (r *RootModel) View() string

type SelectedMsg

type SelectedMsg struct{}

Jump to

Keyboard shortcuts

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