optionsProvider

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputConfig

type InputConfig struct {
	Prompt      string
	Placeholder string
	CharLimit   int
	Width       int
	KeyMap      InputKeyMaps
}

type InputKeyMaps

type InputKeyMaps struct {
	Accept key.Binding
	Back   key.Binding
}

type ListConfig

type ListConfig[T, U any] struct {
	OnSelectAction tea.Msg

	ShowPagination bool
	ShowStatusBar  bool
	ShowHelp       bool
	ShowTitle      bool
	Width, Height  int

	FilteringEnabled bool

	Delegate          list.ItemDelegate
	KeyMap            list.KeyMap
	AdditionalKeymaps *keybinds.ListKeyMap

	ItemMapper func([]T) []list.Item

	GetItemsFunc func(context.Context) ([]T, error)
	Source       string
}

type Option

type Option struct {
	Name    string
	ID      int64
	Subtext string
}

func (Option) Description

func (o Option) Description() string

func (Option) FilterValue

func (o Option) FilterValue() string

func (Option) Title

func (o Option) Title() string

func (Option) Value

func (o Option) Value() int64

type OptionsInput

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

func NewOptionsInput

func NewOptionsInput(config *InputConfig) OptionsInput

func (OptionsInput) Help

func (i OptionsInput) Help() []key.Binding

func (OptionsInput) Init

func (i OptionsInput) Init() tea.Cmd

func (*OptionsInput) OnBlur

func (i *OptionsInput) OnBlur()

func (*OptionsInput) OnFocus

func (i *OptionsInput) OnFocus(id ...int64)

func (*OptionsInput) SetInput

func (i *OptionsInput) SetInput(text string)

func (OptionsInput) Update

func (i OptionsInput) Update(msg tea.Msg) (OptionsInput, tea.Cmd)

func (OptionsInput) View

func (i OptionsInput) View() string

type OptionsProvider

type OptionsProvider[T, U any] struct {
	// contains filtered or unexported fields
}

func NewOptionsProvider

func NewOptionsProvider[T, U any](config *ListConfig[T, U]) OptionsProvider[T, U]

func (OptionsProvider[T, U]) GetSelected

func (o OptionsProvider[T, U]) GetSelected() Option

func (*OptionsProvider[T, U]) Help

func (o *OptionsProvider[T, U]) Help() []key.Binding

func (OptionsProvider[T, U]) Init

func (o OptionsProvider[T, U]) Init() tea.Cmd

func (OptionsProvider[T, U]) IsFiltering

func (o OptionsProvider[T, U]) IsFiltering() bool

func (OptionsProvider[T, U]) OnBlur

func (o OptionsProvider[T, U]) OnBlur()

func (*OptionsProvider[T, U]) OnFocus

func (o *OptionsProvider[T, U]) OnFocus()

func (*OptionsProvider[T, U]) RefreshItems

func (o *OptionsProvider[T, U]) RefreshItems()

func (*OptionsProvider[T, U]) SetGetItemsFunc

func (o *OptionsProvider[T, U]) SetGetItemsFunc(getItems func(context.Context) ([]T, error))

func (OptionsProvider[T, U]) Update

func (o OptionsProvider[T, U]) Update(msg tea.Msg) (OptionsProvider[T, U], tea.Cmd)

func (OptionsProvider[T, U]) View

func (o OptionsProvider[T, U]) View() string

Jump to

Keyboard shortcuts

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