Documentation
¶
Index ¶
- func WithPosition(x, y int, c osui.Component) osui.Component
- func WithSize(width, height int, c osui.Component) osui.Component
- type ButtonComponent
- type ButtonParams
- type ButtonStyle
- type Class
- type DivComponent
- type DivParams
- type DivStyle
- type Id
- type InputBoxComponent
- type InputBoxParams
- type InputBoxStyle
- type MenuComponent
- type MenuParams
- type MenuStyle
- type PaginatorComponent
- type PaginatorParams
- type PaginatorStyle
- type TextComponent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ButtonComponent ¶ added in v0.1.0
type ButtonComponent struct {
Data osui.ComponentData
Style *ButtonStyle
Text string
Toggle bool
Clicked bool
// contains filtered or unexported fields
}
func Button ¶ added in v0.1.0
func Button(text string) *ButtonComponent
func (*ButtonComponent) GetComponentData ¶ added in v0.1.0
func (b *ButtonComponent) GetComponentData() *osui.ComponentData
func (*ButtonComponent) Params ¶ added in v0.1.1
func (b *ButtonComponent) Params(param ButtonParams) *ButtonComponent
func (*ButtonComponent) Render ¶ added in v0.1.0
func (b *ButtonComponent) Render() string
func (*ButtonComponent) Update ¶ added in v0.1.0
func (b *ButtonComponent) Update(key string) bool
type ButtonParams ¶ added in v0.1.3
type ButtonParams struct {
Style ButtonStyle
Toggle bool
OnClick func(*ButtonComponent) bool
Width int
}
type ButtonStyle ¶ added in v0.1.0
type ButtonStyle struct {
Background string `default:"" type:"bg"`
Foreground string `default:"" type:"fg"`
Outline string `default:"" type:"fg"`
ActiveBackground string `default:"" type:"bg"`
ActiveForeground string `default:"\x1b[34m" type:"fg"`
ActiveOutline string `default:"" type:"fg"`
ClickedBackground string `default:"" type:"bg"`
ClickedForeground string `default:"\x1b[32m" type:"fg"`
ClickedOutline string `default:"" type:"fg"`
}
type Class ¶ added in v0.1.3
func (*Class[T]) SetProperties ¶ added in v0.1.3
func (c *Class[T]) SetProperties(ch func(T) T)
type DivComponent ¶ added in v0.1.0
type DivComponent struct {
Data osui.ComponentData
Style *DivStyle
Components []osui.Component
ActiveComponent int
}
func Div ¶ added in v0.1.0
func Div(components ...osui.Component) *DivComponent
func (*DivComponent) GetComponentData ¶ added in v0.1.0
func (d *DivComponent) GetComponentData() *osui.ComponentData
func (*DivComponent) Params ¶ added in v0.1.1
func (b *DivComponent) Params(param DivParams) *DivComponent
func (*DivComponent) Render ¶ added in v0.1.0
func (d *DivComponent) Render() string
func (*DivComponent) Update ¶ added in v0.1.0
func (d *DivComponent) Update(key string) bool
type Id ¶ added in v0.1.3
func (*Id[T]) SetProperties ¶ added in v0.1.3
func (i *Id[T]) SetProperties(c func(T) T)
type InputBoxComponent ¶
type InputBoxComponent struct {
Data osui.ComponentData
Style *InputBoxStyle
InputData string
// contains filtered or unexported fields
}
func InputBox ¶
func InputBox(max_size uint) *InputBoxComponent
func (*InputBoxComponent) GetComponentData ¶
func (s *InputBoxComponent) GetComponentData() *osui.ComponentData
func (*InputBoxComponent) Params ¶ added in v0.1.1
func (b *InputBoxComponent) Params(p interface{}) *InputBoxComponent
func (InputBoxComponent) Render ¶
func (s InputBoxComponent) Render() string
func (*InputBoxComponent) Update ¶
func (s *InputBoxComponent) Update(key string) bool
type InputBoxParams ¶ added in v0.1.1
type InputBoxStyle ¶ added in v0.1.0
type MenuComponent ¶ added in v0.1.0
type MenuComponent struct {
Data osui.ComponentData
Style *MenuStyle
Items []string
SelectedItem int
OnSelected func(*MenuComponent, bool)
}
func Menu ¶ added in v0.1.0
func Menu(items ...string) *MenuComponent
func (*MenuComponent) GetComponentData ¶ added in v0.1.0
func (m *MenuComponent) GetComponentData() *osui.ComponentData
func (*MenuComponent) Params ¶ added in v0.1.1
func (b *MenuComponent) Params(param MenuParams) *MenuComponent
func (*MenuComponent) Render ¶ added in v0.1.0
func (m *MenuComponent) Render() string
func (*MenuComponent) Update ¶ added in v0.1.0
func (m *MenuComponent) Update(key string) bool
type MenuParams ¶ added in v0.1.1
type MenuParams struct {
Style MenuStyle
OnSelected func(*MenuComponent, bool)
}
type PaginatorComponent ¶
type PaginatorComponent struct {
Data osui.ComponentData
Style *PaginatorStyle
Components []osui.Component
ActiveComponent int
}
func Paginator ¶
func Paginator(pages ...osui.Component) *PaginatorComponent
func (*PaginatorComponent) GetComponentData ¶
func (p *PaginatorComponent) GetComponentData() *osui.ComponentData
func (*PaginatorComponent) Params ¶ added in v0.1.1
func (b *PaginatorComponent) Params(p interface{}) *PaginatorComponent
func (*PaginatorComponent) Render ¶
func (p *PaginatorComponent) Render() string
func (*PaginatorComponent) Update ¶ added in v0.1.0
func (p *PaginatorComponent) Update(key string) bool
type PaginatorParams ¶ added in v0.1.1
type PaginatorStyle ¶
type TextComponent ¶
type TextComponent struct {
Data osui.ComponentData
Text string
}
func Text ¶
func Text(text string) *TextComponent
func (*TextComponent) GetComponentData ¶
func (t *TextComponent) GetComponentData() *osui.ComponentData
func (TextComponent) Render ¶
func (t TextComponent) Render() string
func (*TextComponent) Update ¶ added in v0.1.0
func (t *TextComponent) Update(string) bool
Click to show internal directories.
Click to hide internal directories.