multiselect

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Select)

Option the option of Select

func WithChoiceTextStyle

func WithChoiceTextStyle(style *style.Style) Option

WithChoiceTextStyle default is theme.DefaultTheme.ChoiceTextStyle.

func WithCursorSymbol

func WithCursorSymbol(symbol string) Option

WithCursorSymbol default is ">"

func WithCursorSymbolStyle

func WithCursorSymbolStyle(style *style.Style) Option

WithCursorSymbolStyle default is theme.DefaultTheme.CursorSymbolStyle.

func WithDisableFilter

func WithDisableFilter() Option

WithDisableFilter disable filter.

func WithDisableOutputResult

func WithDisableOutputResult() Option

WithDisableOutputResult disable output result.

func WithFilterFunc

func WithFilterFunc(f func(input string, items []components.SelectionItem) []components.SelectionItem) Option

WithFilterFunc replace filter func.

func WithFilterInput

func WithFilterInput(input *components.Input) Option

WithFilterInput replace filter input.

func WithHintSymbol

func WithHintSymbol(selectedStr string) Option

WithHintSymbol default is "✓".

func WithHintSymbolStyle

func WithHintSymbolStyle(style *style.Style) Option

WithHintSymbolStyle default is Theme.MultiSelectedHintSymbolStyle.

func WithKeyBinding

func WithKeyBinding(keymap selection.KeyMap) Option

WithKeyBinding replace key map.

func WithPageSize

func WithPageSize(pageSize int) Option

WithPageSize default is 5

func WithPrompt

func WithPrompt(prompt ...string) Option

WithPrompt default is "Please selection your options:"

func WithPromptStyle

func WithPromptStyle(style *style.Style) Option

WithPromptStyle default is Theme.PromptStyle.

func WithRowRender

func WithRowRender(rowRender func(string, string, string) string) Option

WithRowRender default is

` fmt.Sprintf("%s [%s] %s", cursorSymbol, hintSymbol, choice) `

func WithUnHintSymbol

func WithUnHintSymbol(unSelectedStr string) Option

WithUnHintSymbol default is "✗".

func WithUnHintSymbolStyle

func WithUnHintSymbolStyle(style *style.Style) Option

WithUnHintSymbolStyle default is Theme.UnHintSymbolStyle.

type Select

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

func New

func New(choices []string, ops ...Option) *Select

func (*Select) Apply

func (ms *Select) Apply(ops ...Option) *Select

Apply options on Select

func (*Select) Display

func (ms *Select) Display(prompt ...string) ([]int, error)

Display startup Select

Jump to

Keyboard shortcuts

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