components

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadingViewType = "loading"
	DefaultLoading  = "loading..."
)
View Source
const ErrorViewType = "error"
View Source
const FormViewType = "form"
View Source
const FrameViewType = "frame"

Variables

This section is empty.

Functions

func RunMarkdownView added in v0.0.4

func RunMarkdownView(theme styles.Theme, appName, ctxKey, ctxValue, content string) error

func SubmitMsg added in v0.0.22

func SubmitMsg() tea.Msg

Types

type CollectionView

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

func NewCollectionView

func NewCollectionView(
	state *TerminalState,
	collection types.Collection,
	format Format,
	selectedFunc func(header string) error,
	keys ...KeyCallback,
) *CollectionView

func (*CollectionView) HelpMsg

func (v *CollectionView) HelpMsg() string

func (*CollectionView) Init

func (v *CollectionView) Init() tea.Cmd

func (*CollectionView) Items

func (v *CollectionView) Items() []list.Item

func (*CollectionView) ShowFooter added in v0.0.22

func (v *CollectionView) ShowFooter() bool

func (*CollectionView) Type

func (v *CollectionView) Type() string

func (*CollectionView) Update

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

func (*CollectionView) UpdateItemsFromCollections

func (v *CollectionView) UpdateItemsFromCollections()

func (*CollectionView) View

func (v *CollectionView) View() string

type EntityView

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

func NewEntityView

func NewEntityView(
	state *TerminalState,
	entity types.Entity,
	format Format,
	keys ...KeyCallback,
) *EntityView

func (*EntityView) HelpMsg

func (v *EntityView) HelpMsg() string

func (*EntityView) Init

func (v *EntityView) Init() tea.Cmd

func (*EntityView) ShowFooter added in v0.0.22

func (v *EntityView) ShowFooter() bool

func (*EntityView) Type

func (v *EntityView) Type() string

func (*EntityView) Update

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

func (*EntityView) View

func (v *EntityView) View() string

type ErrorView

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

func NewErrorView

func NewErrorView(err error, styles styles.Theme) *ErrorView

func (*ErrorView) HelpMsg

func (v *ErrorView) HelpMsg() string

func (*ErrorView) Init

func (v *ErrorView) Init() tea.Cmd

func (*ErrorView) ShowFooter added in v0.0.22

func (v *ErrorView) ShowFooter() bool

func (*ErrorView) Type

func (v *ErrorView) Type() string

func (*ErrorView) Update

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

func (*ErrorView) View

func (v *ErrorView) View() string

type Form added in v0.0.22

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

func NewForm added in v0.0.22

func NewForm(
	styles styles.Theme,
	in *os.File,
	out *os.File,
	fields ...*FormField,
) (*Form, error)

func (*Form) Completed added in v0.0.22

func (f *Form) Completed() bool

func (*Form) FindByKey added in v0.0.22

func (f *Form) FindByKey(key string) *FormField

func (*Form) HelpMsg added in v0.0.22

func (f *Form) HelpMsg() string

func (*Form) Init added in v0.0.22

func (f *Form) Init() tea.Cmd

func (*Form) ShowFooter added in v0.0.22

func (f *Form) ShowFooter() bool

func (*Form) Type added in v0.0.22

func (f *Form) Type() string

func (*Form) Update added in v0.0.22

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

func (*Form) ValueMap added in v0.0.22

func (f *Form) ValueMap() map[string]any

func (*Form) View added in v0.0.22

func (f *Form) View() string

type FormField added in v0.0.22

type FormField struct {
	Group uint
	Type  FormFieldType
	Key   string

	Default        string
	Required       bool
	ValidationExpr string
	Title          string
	Description    string
	Placeholder    string
	// contains filtered or unexported fields
}

func (*FormField) Set added in v0.0.22

func (f *FormField) Set(val string)

func (*FormField) SetAndValidate added in v0.0.22

func (f *FormField) SetAndValidate(val string) error

func (*FormField) ValidateConfig added in v0.0.22

func (f *FormField) ValidateConfig() error

func (*FormField) ValidateValue added in v0.0.22

func (f *FormField) ValidateValue(val string) error

func (*FormField) Value added in v0.0.22

func (f *FormField) Value() string

type FormFieldType added in v0.0.22

type FormFieldType uint
const (
	PromptTypeText FormFieldType = iota
	PromptTypeMasked
	PromptTypeMultiline
	PromptTypeConfirm
)

type Format

type Format string
const (
	FormatDocument Format = "doc"
	FormatList     Format = "list"
	FormatJSON     Format = "json"
	FormatYAML     Format = "yaml"
)

type FrameView added in v0.0.13

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

func NewFrameView added in v0.0.13

func NewFrameView(model tea.Model) *FrameView

func (*FrameView) HelpMsg added in v0.0.13

func (v *FrameView) HelpMsg() string

func (*FrameView) Init added in v0.0.13

func (v *FrameView) Init() tea.Cmd

func (*FrameView) ShowFooter added in v0.0.22

func (v *FrameView) ShowFooter() bool

func (*FrameView) Type added in v0.0.13

func (v *FrameView) Type() string

func (*FrameView) Update added in v0.0.13

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

func (*FrameView) View added in v0.0.13

func (v *FrameView) View() string

type KeyCallback

type KeyCallback struct {
	Key      string
	Label    string
	Callback func() error
}

type LoadingView

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

func NewLoadingView

func NewLoadingView(msg string, styles styles.Theme) *LoadingView

func (*LoadingView) HelpMsg

func (v *LoadingView) HelpMsg() string

func (*LoadingView) Init

func (v *LoadingView) Init() tea.Cmd

func (*LoadingView) ShowFooter added in v0.0.22

func (v *LoadingView) ShowFooter() bool

func (*LoadingView) Type

func (v *LoadingView) Type() string

func (*LoadingView) Update

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

func (*LoadingView) View

func (v *LoadingView) View() string

type LogArchiveView added in v0.0.4

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

func NewLogArchiveView added in v0.0.4

func NewLogArchiveView(state *TerminalState, archiveDir string, lastEntry bool) *LogArchiveView

func (*LogArchiveView) HelpMsg added in v0.0.4

func (v *LogArchiveView) HelpMsg() string

func (*LogArchiveView) Init added in v0.0.4

func (v *LogArchiveView) Init() tea.Cmd

func (*LogArchiveView) ShowFooter added in v0.0.22

func (v *LogArchiveView) ShowFooter() bool

func (*LogArchiveView) Type added in v0.0.4

func (v *LogArchiveView) Type() string

func (*LogArchiveView) Update added in v0.0.4

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

func (*LogArchiveView) View added in v0.0.4

func (v *LogArchiveView) View() string

type MarkdownView

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

func (*MarkdownView) HelpMsg

func (v *MarkdownView) HelpMsg() string

func (*MarkdownView) Init

func (v *MarkdownView) Init() tea.Cmd

func (*MarkdownView) RunProgram added in v0.0.4

func (v *MarkdownView) RunProgram() error

func (*MarkdownView) ShowFooter added in v0.0.22

func (v *MarkdownView) ShowFooter() bool

func (*MarkdownView) Type

func (v *MarkdownView) Type() string

func (*MarkdownView) Update

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

func (*MarkdownView) View

func (v *MarkdownView) View() string

type NoticeLevel

type NoticeLevel string

type SubmitMsgType added in v0.0.22

type SubmitMsgType struct{}

type TerminalState

type TerminalState struct {
	Width  int
	Height int
	Theme  styles.Theme
}

type TickMsg

type TickMsg time.Time

Jump to

Keyboard shortcuts

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