widget

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type BaseWidget

func New

func New(htmlTag string) BaseWidget

func NewNS

func NewNS(namespace string, htmlTag string) BaseWidget

func NewWithOptions

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

type Event

type Event js.Value

func (Event) PreventDefault

func (e Event) PreventDefault()

func (Event) StopPropagation

func (e Event) StopPropagation()

type Widget

type Widget js.Value

func (Widget) AddClass

func (w Widget) AddClass(class string)

func (Widget) AppendChild

func (w Widget) AppendChild(child Widget)

func (Widget) Call

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

func (Widget) ChildAt

func (w Widget) ChildAt(index int) Widget

func (Widget) Equal

func (w Widget) Equal(other BaseWidget) bool

func (Widget) Get

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

func (Widget) ID

func (w Widget) ID() string

func (Widget) IsNull

func (w Widget) IsNull() bool

func (Widget) Parent

func (w Widget) Parent() Widget

func (Widget) Remove

func (w Widget) Remove()

func (Widget) RemoveClass

func (w Widget) RemoveClass(class string)

func (Widget) ReplaceWith

func (w Widget) ReplaceWith(widget Widget)

func (Widget) Set

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

func (Widget) SetAttribute

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

func (Widget) SetAttributeNS

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

func (Widget) SetClass

func (w Widget) SetClass(class string)

func (Widget) SetID

func (w Widget) SetID(id string)

func (Widget) SetOnClick

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

func (Widget) SetStyle

func (w Widget) SetStyle(style string)

func (Widget) SetText

func (w Widget) SetText(text string)

func (Widget) ToggleClass

func (w Widget) ToggleClass(class string)

func (Widget) UpdateStyleProperty

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

type WidgetContext

type WidgetContext struct {
	Current js.Value
	Doc     js.Value
	Root    Widget
}

func Context

func Context() *WidgetContext

func NewContext

func NewContext() *WidgetContext

func (*WidgetContext) AppendChild

func (c *WidgetContext) AppendChild(child BaseWidget)

func (*WidgetContext) ClientHeight

func (c *WidgetContext) ClientHeight() int

func (*WidgetContext) ClientWidth

func (c *WidgetContext) ClientWidth() int

func (*WidgetContext) CreateElement

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

func (*WidgetContext) CreateElementNS

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

func (*WidgetContext) CreateElementWithOptions

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

func (*WidgetContext) CurrentPath

func (c *WidgetContext) CurrentPath() string

func (*WidgetContext) GetElementByID

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

func (*WidgetContext) GoBack

func (c *WidgetContext) GoBack()

func (*WidgetContext) Navigate

func (c *WidgetContext) Navigate(path string)

func (*WidgetContext) OnNavigate

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

func (*WidgetContext) OnResize

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

func (*WidgetContext) PushState

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

Jump to

Keyboard shortcuts

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