vui

package
v0.0.0-...-ece5352 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorNode                 NodeType = 0
	ElementNode                        = 1
	AttributeNode                      = 2
	TextNode                           = 3
	CDATASectionNode                   = 4
	ProcessingInstructionNode          = 7
	CommentNode                        = 8
	DocumentNode                       = 9
	DocumentTypeNode                   = 10
	DocumentFragmentNode               = 11
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorElm

type AnchorElm struct {
	*Elm
}

func (*AnchorElm) New

func (e *AnchorElm) New(opts ...interface{}) Elementary

type Attributer

type Attributer interface {
	ApplyAttr([]html.Attribute)
}

type BodyElm

type BodyElm struct {
	*Elm
}

func (*BodyElm) New

func (e *BodyElm) New(opts ...interface{}) Elementary

type BrElm

type BrElm struct {
	*Elm
}

func (*BrElm) New

func (e *BrElm) New(opts ...interface{}) Elementary

type ButtonElm

type ButtonElm struct {
	*Elm
}

func (*ButtonElm) New

func (e *ButtonElm) New(opts ...interface{}) Elementary

type CSSRule

type CSSRule struct{}

type CSSRuleList

type CSSRuleList []CSSRule

type CSSStyleDecl

type CSSStyleDecl struct {
	Text string
	// contains filtered or unexported fields
}

func NewCSSStyleDecl

func NewCSSStyleDecl(text string) CSSStyleDecl

func (CSSStyleDecl) GetPropertyValue

func (s CSSStyleDecl) GetPropertyValue(name string) string

type CSSStyleSheet

type CSSStyleSheet struct{}

type Constructor

type Constructor interface {
	New(...interface{}) Elementary
}

type CustomElemRegistry

type CustomElemRegistry map[string]Elementary

CustomElmRegistry is runtime regiter custom elemenent

type DivElm

type DivElm struct {
	*Elm
}

func (*DivElm) New

func (e *DivElm) New(opts ...interface{}) Elementary

type Document

type Document struct {
	*Node
	ActiveElement     Elm
	AlinkColor        HexColor
	Body              Elm
	ChildElementCount int
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument() *Document

func (*Document) CreateElement

func (d *Document) CreateElement(tag string, opts ...interface{}) (Elementary, error)

func (*Document) CreateText

func (c *Document) CreateText(val string) (Texter, error)

type Documentary

type Documentary interface {
	INode
	CreateElement(string, ...interface{}) (Elementary, error)
	CreateText(string) (Texter, error)
}

type Elementary

type Elementary interface {
	INode
	SetInnerHTML(string)
	InnerHTML() string
	Style() CSSStyleDecl
	Class() string
	ClassList() []string
	SetClass(...string)
	SetId(string)
	Id() string
}

type Elm

type Elm struct {
	*Node
	// contains filtered or unexported fields
}

func NewElm

func NewElm(opts ...interface{}) *Elm

func (*Elm) Class

func (el *Elm) Class() string

func (*Elm) ClassList

func (el *Elm) ClassList() []string

func (*Elm) Id

func (el *Elm) Id() string

func (*Elm) InnerHTML

func (el *Elm) InnerHTML() string

func (*Elm) SetClass

func (el *Elm) SetClass(classes ...string)

func (*Elm) SetId

func (el *Elm) SetId(id string)

func (*Elm) SetInnerHTML

func (el *Elm) SetInnerHTML(content string)

@TODO: content must be decoder XML or HTML

func (*Elm) Style

func (el *Elm) Style() CSSStyleDecl

type ElmFactory

type ElmFactory interface {
	Factory(tag string) (elmFacMethod, error)
}

Factory method use to create new element

type ElmOpt

type ElmOpt func(*Elm)

func WithClass

func WithClass(classes ...string) ElmOpt

func WithId

func WithId(id string) ElmOpt

func WithStyle

func WithStyle(text string) ElmOpt

type ElmRegistry

type ElmRegistry map[string]Elementary

Registry use to register default elements

type EventTarger

type EventTarger interface {
	// contains filtered or unexported methods
}

type FieldSetElm

type FieldSetElm struct {
	*Elm
}

func (*FieldSetElm) New

func (e *FieldSetElm) New(opts ...interface{}) Elementary

type FormElm

type FormElm struct {
	*Elm
}

func (*FormElm) New

func (e *FormElm) New(opts ...interface{}) Elementary

type HeadElm

type HeadElm struct {
	*Elm
}

func (*HeadElm) New

func (e *HeadElm) New(opts ...interface{}) Elementary

type HeadingElm

type HeadingElm struct {
	*Elm
	// contains filtered or unexported fields
}

func (*HeadingElm) New

func (e *HeadingElm) New(opts ...interface{}) Elementary

type HexColor

type HexColor string

type HrElm

type HrElm struct {
	*Elm
}

func (*HrElm) New

func (e *HrElm) New(opts ...interface{}) Elementary

type HtmlElm

type HtmlElm struct {
	*Elm
}

func (*HtmlElm) New

func (e *HtmlElm) New(opts ...interface{}) Elementary

type INode

type INode interface {
	AppendChild(...INode) error
	CloneNode(bool) INode
	Contains(INode) bool
	GetRootNode() INode
	HasChildNodes() bool
	InsertBefore()
	IsDefaultNamespace() bool
	IsEqualNode() bool
	IsSameNode() bool
	Normalize()
	RemoveChild()
	ReplaceChild()

	/* Getters for properties */
	ChildNodes() NodeList
	IsConnected() bool
	NextSibling() INode
	PreviousSibling() INode
	OwnerDocument() Documentary
	NodeName() string
	NodeValue() string

	/* Setter for properties */
	SetOwnerDocument(Documentary) error
	SetTextContent(string)
	// contains filtered or unexported methods
}

Interface port from DOM WebAPI https://developer.mozilla.org/en-US/docs/Web/API/Node Note: The line comment out means not implement yet

type ImgElementary

type ImgElementary interface {
	Elementary
	Attributer
	Src() string
	Width() int
	Height() int
}

type ImgElm

type ImgElm struct {
	*Elm
	// contains filtered or unexported fields
}

func (*ImgElm) ApplyAttr

func (e *ImgElm) ApplyAttr(attrs []html.Attribute)

func (*ImgElm) Height

func (e *ImgElm) Height() int

func (*ImgElm) New

func (e *ImgElm) New(opts ...interface{}) Elementary

func (*ImgElm) Src

func (e *ImgElm) Src() string

func (*ImgElm) Width

func (e *ImgElm) Width() int

type ImgOpt

type ImgOpt func(*ImgElm)

type InputElm

type InputElm struct {
	*Elm
}

func (*InputElm) New

func (e *InputElm) New(opts ...interface{}) Elementary

type LabelElm

type LabelElm struct {
	*Elm
}

func (*LabelElm) New

func (e *LabelElm) New(opts ...interface{}) Elementary

type LegendElm

type LegendElm struct {
	*Elm
}

func (*LegendElm) New

func (e *LegendElm) New(opts ...interface{}) Elementary

type Node

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

func NewNode

func NewNode(opts ...NodeOpt) *Node

func (*Node) AppendChild

func (n *Node) AppendChild(nl ...INode) error

AppendChild() adds a node to the end of the children node. If the given child is a reference to an existing node in the document, appendChild() moves it from its current position to the new position.

func (*Node) ChildNodes

func (n *Node) ChildNodes() NodeList

ChildNodes return the Nodelist of children's node

func (*Node) CloneNode

func (n *Node) CloneNode(deep bool) INode

func (*Node) Contains

func (n *Node) Contains(node INode) bool

func (*Node) GetRootNode

func (n *Node) GetRootNode() INode

func (*Node) HasChildNodes

func (n *Node) HasChildNodes() bool

func (*Node) InsertBefore

func (n *Node) InsertBefore()

func (*Node) IsConnected

func (n *Node) IsConnected() bool

func (*Node) IsDefaultNamespace

func (n *Node) IsDefaultNamespace() bool

func (*Node) IsEqualNode

func (n *Node) IsEqualNode() bool

func (*Node) IsSameNode

func (n *Node) IsSameNode() bool

func (*Node) NextSibling

func (n *Node) NextSibling() INode

func (*Node) NodeName

func (n *Node) NodeName() string

ChildNodes return the Nodelist of children's node

func (*Node) NodeValue

func (n *Node) NodeValue() string

ChildNodes return the Nodelist of children's node

func (*Node) Normalize

func (n *Node) Normalize()

func (*Node) OwnerDocument

func (n *Node) OwnerDocument() Documentary

func (*Node) PreviousSibling

func (n *Node) PreviousSibling() INode

func (*Node) RemoveChild

func (n *Node) RemoveChild()

func (*Node) ReplaceChild

func (n *Node) ReplaceChild()

func (*Node) SetOwnerDocument

func (n *Node) SetOwnerDocument(doc Documentary) error

func (*Node) SetTextContent

func (n *Node) SetTextContent(content string)

type NodeList

type NodeList []INode

func (NodeList) First

func (l NodeList) First() INode

func (NodeList) Last

func (l NodeList) Last() INode

type NodeOpt

type NodeOpt func(*Node)

func WithNodeValue

func WithNodeValue(val string) NodeOpt

type OptGroupElm

type OptGroupElm struct {
	*Elm
}

func (*OptGroupElm) New

func (e *OptGroupElm) New(opts ...interface{}) Elementary

type OptionElm

type OptionElm struct {
	*Elm
}

func (*OptionElm) New

func (e *OptionElm) New(opts ...interface{}) Elementary

type ParagraphElm

type ParagraphElm struct {
	*Elm
}

func (*ParagraphElm) New

func (e *ParagraphElm) New(opts ...interface{}) Elementary

type SelectElm

type SelectElm struct {
	*Elm
}

func (*SelectElm) New

func (e *SelectElm) New(opts ...interface{}) Elementary

type SpanElm

type SpanElm struct {
	*Elm
}

func (*SpanElm) New

func (e *SpanElm) New(opts ...interface{}) Elementary

type Text

type Text struct {
	*Node
}

func (*Text) New

func (t *Text) New(val string) *Text

type Texter

type Texter interface {
	INode
}

type UnknownElm

type UnknownElm struct {
	*Elm
}

func (*UnknownElm) New

func (e *UnknownElm) New(opts ...interface{}) Elementary

Jump to

Keyboard shortcuts

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