dom

package
v0.0.0-...-f1d979d Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(s string)

Types

type A

type A struct{ Elt }

func Anchor

func Anchor(s string) A

func (A) WithText

func (a A) WithText(s string) A

type Attrs

type Attrs map[string]string

type Btn

type Btn struct{ Elt }

func Button

func Button(s string) Btn

func (Btn) OnClick

func (b Btn) OnClick(flags js.EventCallbackFlag, fn func(js.Value)) js.Callback

func (Btn) WithClass

func (b Btn) WithClass(c string) Btn

type Doc

type Doc struct{ NodeBase }
var (
	Document Doc
	Body     js.Value
)

func (Doc) CreateElement

func (d Doc) CreateElement(tag string) Elt

func (Doc) GetElementById

func (d Doc) GetElementById(id string) Elt

type Elt

type Elt struct{ NodeBase }

func Div

func Div() Elt

func Element

func Element(tag string) Elt

func Form

func Form() Elt

func Label

func Label(s string) Elt

func Span

func Span(s string) Elt

func Text

func Text(s string) Elt

func (Elt) AddClass

func (e Elt) AddClass(c string)

func (Elt) AsAnchor

func (e Elt) AsAnchor() A

func (Elt) AsButton

func (e Elt) AsButton() Btn

func (Elt) AsInput

func (e Elt) AsInput() Inp

func (Elt) GetClass

func (e Elt) GetClass() *string

func (Elt) RemoveAttribute

func (e Elt) RemoveAttribute(k string)

func (Elt) RemoveClass

func (e Elt) RemoveClass(c string)

func (Elt) SetAttribute

func (e Elt) SetAttribute(k, v string)

func (Elt) SetClass

func (e Elt) SetClass(c string)

func (Elt) SetInnerHTML

func (e Elt) SetInnerHTML(s string)

func (Elt) SetRole

func (e Elt) SetRole(r string)

func (Elt) WithAttribute

func (e Elt) WithAttribute(k, v string) Elt

func (Elt) WithAttributeRemoved

func (e Elt) WithAttributeRemoved(k string) Elt

func (Elt) WithAttributes

func (e Elt) WithAttributes(attrs Attrs) Elt

func (Elt) WithChildren

func (e Elt) WithChildren(ns ...Node) Elt

func (Elt) WithClass

func (e Elt) WithClass(c string) Elt

func (Elt) WithClassAdded

func (e Elt) WithClassAdded(c string) Elt

func (Elt) WithClassRemoved

func (e Elt) WithClassRemoved(c string) Elt

func (Elt) WithRole

func (e Elt) WithRole(r string) Elt

type Inp

type Inp struct{ Elt }

func Input

func Input(typ string) Inp

func TextInput

func TextInput() Inp

func (Inp) OnKeyUp

func (i Inp) OnKeyUp(flags js.EventCallbackFlag, fn func(js.Value)) js.Callback

func (Inp) Value

func (i Inp) Value() string

func (Inp) WithClass

func (i Inp) WithClass(c string) Inp

func (Inp) WithPlaceholder

func (i Inp) WithPlaceholder(p string) Inp

func (Inp) WithValue

func (i Inp) WithValue(val string) Inp

type Node

type Node interface {
	JSValue() js.Value

	AppendChild(c Node)
	RemoveChild(c Node) Node
}

type NodeBase

type NodeBase struct{ js.Value }

func (NodeBase) AddEventListener

func (n NodeBase) AddEventListener(flags js.EventCallbackFlag, typ string, fn func(js.Value)) js.Callback

func (NodeBase) AppendChild

func (n NodeBase) AppendChild(c Node)

func (NodeBase) AsElement

func (n NodeBase) AsElement() Elt

func (NodeBase) FirstChild

func (n NodeBase) FirstChild() Node

func (NodeBase) JSValue

func (n NodeBase) JSValue() js.Value

func (NodeBase) ParentNode

func (n NodeBase) ParentNode() Node

func (NodeBase) Remove

func (n NodeBase) Remove()

func (NodeBase) RemoveAllChildren

func (n NodeBase) RemoveAllChildren()

func (NodeBase) RemoveChild

func (n NodeBase) RemoveChild(c Node) Node

type Tbl

type Tbl struct {
	Elt
	// contains filtered or unexported fields
}

func Table

func Table() Tbl

func (Tbl) AppendRow

func (t Tbl) AppendRow(ns ...Node) Elt

func (Tbl) WithClass

func (t Tbl) WithClass(c string) Tbl

func (Tbl) WithHeader

func (t Tbl) WithHeader(ns ...Node) Tbl

func (Tbl) WithHeaderClass

func (t Tbl) WithHeaderClass(class string) Tbl

Jump to

Keyboard shortcuts

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