application

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nil = BaseWidget{Widget: Widget(js.Value{})}
)

Functions

func AddPageLoadedListener added in v0.0.4

func AddPageLoadedListener(listener PageLoadedCallback)

func Run

func Run(app BaseWidget)

Types

type AppContext added in v0.0.4

type AppContext struct {
	Current  js.Value
	Doc      js.Value
	Root     Widget
	Scaffold any // scaffold.Scaffold
}

func Context added in v0.0.4

func Context() *AppContext

func NewContext added in v0.0.4

func NewContext() *AppContext

func (*AppContext) AppendChild added in v0.0.4

func (c *AppContext) AppendChild(child BaseWidget)

func (*AppContext) ClientHeight added in v0.0.4

func (c *AppContext) ClientHeight() int

func (*AppContext) ClientWidth added in v0.0.4

func (c *AppContext) ClientWidth() int

func (*AppContext) CreateElement added in v0.0.4

func (c *AppContext) CreateElement(tag string) Widget

func (*AppContext) CreateElementNS added in v0.0.4

func (c *AppContext) CreateElementNS(namespace string, tag string) Widget

func (*AppContext) CreateElementWithOptions added in v0.0.4

func (c *AppContext) CreateElementWithOptions(tag string, options map[string]any) Widget

func (*AppContext) CurrentPath added in v0.0.4

func (c *AppContext) CurrentPath() string

func (*AppContext) GetElementByID added in v0.0.4

func (c *AppContext) GetElementByID(id string) *Widget

func (*AppContext) GoBack added in v0.0.4

func (c *AppContext) GoBack()

func (*AppContext) Navigate added in v0.0.4

func (c *AppContext) Navigate(path string)

func (*AppContext) OnNavigate added in v0.0.4

func (c *AppContext) OnNavigate(callback func(path string))

func (*AppContext) OnResize added in v0.0.4

func (c *AppContext) OnResize(callback func())
func (c *AppContext) OpenLink(href string)

func (*AppContext) PushState added in v0.0.4

func (c *AppContext) PushState(state any, title string, url string)

type BaseWidget added in v0.0.4

func New added in v0.0.4

func New(htmlTag string) BaseWidget

func NewNS added in v0.0.4

func NewNS(namespace string, htmlTag string) BaseWidget

func NewWithOptions added in v0.0.4

func NewWithOptions(htmlTag string, options map[string]any) BaseWidget

type Event added in v0.0.4

type Event js.Value

func (Event) PreventDefault added in v0.0.4

func (e Event) PreventDefault()

func (Event) StopPropagation added in v0.0.4

func (e Event) StopPropagation()

type PageLoadedCallback added in v0.0.4

type PageLoadedCallback func()

type PageLoadedListeners added in v0.0.4

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

type Widget added in v0.0.4

type Widget js.Value

func (Widget) AddClass added in v0.0.4

func (w Widget) AddClass(class string)

func (Widget) AppendChild added in v0.0.4

func (w Widget) AppendChild(child Widget)

func (Widget) Call added in v0.0.4

func (w Widget) Call(m string, args ...any) Widget

func (Widget) ChildAt added in v0.0.4

func (w Widget) ChildAt(index int) Widget

func (Widget) Equal added in v0.0.4

func (w Widget) Equal(other BaseWidget) bool

func (Widget) Get added in v0.0.4

func (w Widget) Get(p string) js.Value

func (Widget) ID added in v0.0.4

func (w Widget) ID() string

func (Widget) IsNull added in v0.0.4

func (w Widget) IsNull() bool

func (Widget) Parent added in v0.0.4

func (w Widget) Parent() Widget

func (Widget) Remove added in v0.0.4

func (w Widget) Remove()

func (Widget) RemoveClass added in v0.0.4

func (w Widget) RemoveClass(class string)

func (Widget) ReplaceWith added in v0.0.4

func (w Widget) ReplaceWith(widget Widget)

func (Widget) Set added in v0.0.4

func (w Widget) Set(p string, v any)

func (Widget) SetAttribute added in v0.0.4

func (w Widget) SetAttribute(p string, v any)

func (Widget) SetAttributeNS added in v0.0.4

func (w Widget) SetAttributeNS(namespace string, p string, v any)

func (Widget) SetClass added in v0.0.4

func (w Widget) SetClass(class string)

func (Widget) SetDraggable added in v0.0.6

func (w Widget) SetDraggable(draggable bool)

func (Widget) SetID added in v0.0.4

func (w Widget) SetID(id string)

func (Widget) SetOnClick added in v0.0.4

func (w Widget) SetOnClick(onClick func(this BaseWidget, e Event))

func (Widget) SetOnDrag added in v0.0.6

func (w Widget) SetOnDrag(onDrag func(this BaseWidget, e Event))

func (Widget) SetOnDragEnd added in v0.0.6

func (w Widget) SetOnDragEnd(onDragEnd func(this BaseWidget, e Event))

func (Widget) SetOnDragStart added in v0.0.6

func (w Widget) SetOnDragStart(onDragStart func(this BaseWidget, e Event))

func (Widget) SetStyle added in v0.0.4

func (w Widget) SetStyle(style string)

func (Widget) SetText added in v0.0.4

func (w Widget) SetText(text string)

func (Widget) ToggleClass added in v0.0.4

func (w Widget) ToggleClass(class string)

func (Widget) UpdateStyleProperty added in v0.0.4

func (w Widget) UpdateStyleProperty(property string, value string)

Jump to

Keyboard shortcuts

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