html

package
v0.0.0-...-d107f78 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attr

func Attr(k string, v any) *elementAttribute

func Case

func Case(when func() bool, node Node, deps ...vigor.GetterFn) *switchCase

func Class

func Class(v ...any) *elementClass

func On

func On(ev string, fn JSEventFunc) *elementEvent

func Property

func Property(k string, v any) *elementProperty

func Style

func Style(property string, value any) *elementStyle

func SubscribedText

func SubscribedText(fn SubscribedTextFunc) *subscribedText

Types

type AttributeElementPlugin

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

func (*AttributeElementPlugin) HandleChild

func (p *AttributeElementPlugin) HandleChild(child any) (bool, error)

func (*AttributeElementPlugin) Render

func (p *AttributeElementPlugin) Render(doc, obj js.Value) error

type ChildrenElementPlugin

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

func (*ChildrenElementPlugin) HandleChild

func (p *ChildrenElementPlugin) HandleChild(child any) (bool, error)

func (*ChildrenElementPlugin) Render

func (p *ChildrenElementPlugin) Render(doc, obj js.Value) error

type ClassElementPlugin

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

func (*ClassElementPlugin) HandleChild

func (p *ClassElementPlugin) HandleChild(child any) (bool, error)

func (*ClassElementPlugin) Render

func (p *ClassElementPlugin) Render(doc, obj js.Value) error

type ElementPlugin

type ElementPlugin interface {
	HandleChild(child any) (bool, error)
	Render(doc, obj js.Value) error
}

func NewAttributeElementPlugin

func NewAttributeElementPlugin() ElementPlugin

func NewChildrenElementPlugin

func NewChildrenElementPlugin() ElementPlugin

func NewClassElementPlugin

func NewClassElementPlugin() ElementPlugin

func NewPropertyElementPlugin

func NewPropertyElementPlugin() ElementPlugin

func NewStyleElementPlugin

func NewStyleElementPlugin() ElementPlugin

type JSEventFunc

type JSEventFunc func(this js.Value, args []js.Value)

type Node

type Node interface {
	DOMObject(document js.Value) js.Value
}

func Dynamic

func Dynamic(fn func(vigor.Subscriber) Node) Node

func El

func El(name string, children ...any) Node

func ErrorBoundary

func ErrorBoundary(fallbackFn func(err any) Node, children ...Node) Node

func For

func For(v any, fn func(i int, v any) Node) Node

func Index

func Index(v vigor.GetterFn, fn func(i int, v any) Node) Node

func NEl

func NEl(namespace, name string, children ...any) Node

func NewNode

func NewNode(domObjectFn func(js.Value) js.Value) Node

func Portal

func Portal(node Node) Node

func Show

func Show(
	when vigor.GetterFn,
	truthy Node,
	falsey Node,
) Node

func Switch

func Switch(defaultNode Node, cases ...*switchCase) Node

func Text

func Text(texts ...any) Node

type PropertyElementPlugin

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

func (*PropertyElementPlugin) HandleChild

func (p *PropertyElementPlugin) HandleChild(child any) (bool, error)

func (*PropertyElementPlugin) Render

func (p *PropertyElementPlugin) Render(doc, obj js.Value) error

type StyleElementPlugin

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

func (*StyleElementPlugin) HandleChild

func (p *StyleElementPlugin) HandleChild(child any) (bool, error)

func (*StyleElementPlugin) Render

func (p *StyleElementPlugin) Render(doc, obj js.Value) error

type SubscribedTextFunc

type SubscribedTextFunc func(vigor.Subscriber) any

Jump to

Keyboard shortcuts

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