userio

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateTreeSelection

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

Types

type BubbleTeaSeedablesPrompter

type BubbleTeaSeedablesPrompter struct {
	Logger                logger.ILogger
	Message               string
	TreeChoices           []PromptTreeElement
	Breadcrump            []string
	FullySelectedTreeChar string // the character to display when a tree element is fully selected
	SemiSelectedTreeChar  string // the character to display when a tree element is partially selected
	UnselectedTreeChar    string // the character to display when a tree element is not selected
	ElementsCount         int

	IsTreeChoices      bool
	IsConfirmation     bool
	ConfirmationResult bool
	UserInputText      string
	// contains filtered or unexported fields
}

func (*BubbleTeaSeedablesPrompter) Confirmation

func (m *BubbleTeaSeedablesPrompter) Confirmation(msg string) (result bool, err error)

func (*BubbleTeaSeedablesPrompter) ConfirmationView

func (m *BubbleTeaSeedablesPrompter) ConfirmationView() string

func (*BubbleTeaSeedablesPrompter) Init

func (*BubbleTeaSeedablesPrompter) MultiChooseTree

func (m *BubbleTeaSeedablesPrompter) MultiChooseTree(msg string, choices []PromptTreeElement) (selected []PromptTreeElement, err error)

func (*BubbleTeaSeedablesPrompter) PropagateCounterIndexToTree

func (m *BubbleTeaSeedablesPrompter) PropagateCounterIndexToTree(total int, tree []PromptTreeElement) (int, []PromptTreeElement)

func (*BubbleTeaSeedablesPrompter) TreeSelectionView

func (m *BubbleTeaSeedablesPrompter) TreeSelectionView(level int, message string, breadcrump []string, choices []PromptTreeElement, finishMessage string) string

func (*BubbleTeaSeedablesPrompter) Update

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

func (*BubbleTeaSeedablesPrompter) UpdateConfirmation

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

func (*BubbleTeaSeedablesPrompter) View

type PromptTreeElement

type PromptTreeElement struct {
	Title        string
	Selected     bool
	Level        int
	CounterIndex int
	SubElements  []PromptTreeElement
}

func ToggleSelectedTreeElement

func ToggleSelectedTreeElement(targetindex int, tree []PromptTreeElement) (result []PromptTreeElement, found bool)

type Prompter

type Prompter interface {
	MultiChooseTree(msg string, choices []PromptTreeElement) (selected []PromptTreeElement, err error)
	Confirmation(msg string) (bool, error)
}

Jump to

Keyboard shortcuts

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