views

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 25 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

This section is empty.

Types

type CollectionView

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

func NewCollectionView

func NewCollectionView(
	state *types.RenderState,
	collection types.Collection,
	format types.Format,
	selectedFunc func(header string) error,
	keys ...types.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

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 *types.RenderState,
	entity types.Entity,
	format types.Format,
	keys ...types.KeyCallback,
) *EntityView

func (*EntityView) HelpMsg

func (v *EntityView) HelpMsg() string

func (*EntityView) Init

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

func (*EntityView) ShowFooter

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, theme styles.Theme) *ErrorView

func (*ErrorView) HelpMsg

func (v *ErrorView) HelpMsg() string

func (*ErrorView) Init

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

func (*ErrorView) ShowFooter

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

type Form struct {
	Callback func(map[string]any) error
	// contains filtered or unexported fields
}

func NewForm

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

NewForm creates a new form model that can be run in a Bubble Tea program. It includes some extra handling for reading piped input. This form should NOT be used in a tuikit container. Instead, use NewFormView.

func NewFormView

func NewFormView(
	state *types.RenderState,
	fields ...*FormField,
) (*Form, error)

NewFormView creates a new form view that can be used in the tuikit container.

func (*Form) Completed

func (f *Form) Completed() bool

func (*Form) FindByKey

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

func (*Form) HelpMsg

func (f *Form) HelpMsg() string

func (*Form) Init

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

func (*Form) Run

func (f *Form) Run(ctx context.Context) error

func (*Form) ShowFooter

func (f *Form) ShowFooter() bool

func (*Form) Type

func (f *Form) Type() string

func (*Form) Update

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

func (*Form) ValueMap

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

func (*Form) View

func (f *Form) View() string

type FormField

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

func (f *FormField) Set(val string)

func (*FormField) SetAndValidate

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

func (*FormField) ValidateConfig

func (f *FormField) ValidateConfig() error

func (*FormField) ValidateValue

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

func (*FormField) Value

func (f *FormField) Value() string

type FormFieldType

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

type FrameView

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

func NewFrameView

func NewFrameView(model tea.Model) *FrameView

func (*FrameView) HelpMsg

func (v *FrameView) HelpMsg() string

func (*FrameView) Init

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

func (*FrameView) ShowFooter

func (v *FrameView) ShowFooter() bool

func (*FrameView) Type

func (v *FrameView) Type() string

func (*FrameView) Update

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

func (*FrameView) View

func (v *FrameView) View() string

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

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

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

func NewLogArchiveView

func NewLogArchiveView(state *types.RenderState, archiveDir string, lastEntry bool) *LogArchiveView

func (*LogArchiveView) HelpMsg

func (v *LogArchiveView) HelpMsg() string

func (*LogArchiveView) Init

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

func (*LogArchiveView) ShowFooter

func (v *LogArchiveView) ShowFooter() bool

func (*LogArchiveView) Type

func (v *LogArchiveView) Type() string

func (*LogArchiveView) Update

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

func (*LogArchiveView) View

func (v *LogArchiveView) View() string

type MarkdownView

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

func NewMarkdownView

func NewMarkdownView(state *types.RenderState, content string) *MarkdownView

func (*MarkdownView) HelpMsg

func (v *MarkdownView) HelpMsg() string

func (*MarkdownView) Init

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

func (*MarkdownView) ShowFooter

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

Jump to

Keyboard shortcuts

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