component

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(c Component) string

func GenerateChild

func GenerateChild(c Component, key string) string

func ReRender

func ReRender(c Component) error

Types

type BaseComponent

type BaseComponent struct {
	JsBase
	Key              string
	Tag              string
	Value            string
	PostValue        string
	Parent           Component
	Children         map[string]Component
	ChildrenIndexMap []string
	Iterator         uint
	Callbacks        map[string]interface{}
	Attributes       map[string]string
	SelfClosing      bool
}

func (*BaseComponent) AddChild

func (bc *BaseComponent) AddChild(child Component)

func (*BaseComponent) Callback

func (bc *BaseComponent) Callback(event string, args ...interface{}) Component

func (*BaseComponent) GetAttribute

func (bc *BaseComponent) GetAttribute(key string) string

func (*BaseComponent) GetAttributes

func (bc *BaseComponent) GetAttributes() map[string]string

func (*BaseComponent) GetCallback

func (bc *BaseComponent) GetCallback(key string) interface{}

func (*BaseComponent) GetCallbacks

func (bc *BaseComponent) GetCallbacks() map[string]interface{}

func (*BaseComponent) GetChild

func (bc *BaseComponent) GetChild(key string) Component

func (*BaseComponent) GetChildren

func (bc *BaseComponent) GetChildren() map[string]Component

func (*BaseComponent) GetChildrenList added in v0.0.2

func (bc *BaseComponent) GetChildrenList() []Component

func (*BaseComponent) GetId

func (bc *BaseComponent) GetId() string

func (*BaseComponent) GetKey

func (bc *BaseComponent) GetKey() string

func (*BaseComponent) GetParent

func (bc *BaseComponent) GetParent() Component

func (*BaseComponent) GetPostValue added in v0.0.2

func (bc *BaseComponent) GetPostValue() string

func (*BaseComponent) GetTag

func (bc *BaseComponent) GetTag() string

func (*BaseComponent) GetValue added in v0.0.2

func (bc *BaseComponent) GetValue() string

func (*BaseComponent) HasChildren

func (bc *BaseComponent) HasChildren() bool

func (*BaseComponent) IsSelfClosing added in v0.0.2

func (bc *BaseComponent) IsSelfClosing() bool

func (*BaseComponent) OnMessage

func (bc *BaseComponent) OnMessage(message *Message) Component

func (*BaseComponent) RegisterOnClick

func (bc *BaseComponent) RegisterOnClick(callback interface{}) Component

func (*BaseComponent) Render

func (bc *BaseComponent) Render() string

func (*BaseComponent) SetAttribute

func (bc *BaseComponent) SetAttribute(key, value string)

func (*BaseComponent) SetCallback

func (bc *BaseComponent) SetCallback(key string, callback interface{})

func (*BaseComponent) SetChild

func (bc *BaseComponent) SetChild(key string, child Component)

func (*BaseComponent) SetKey

func (bc *BaseComponent) SetKey(key string)

func (*BaseComponent) SetParent

func (bc *BaseComponent) SetParent(c Component)

func (*BaseComponent) SetPostValue added in v0.0.2

func (bc *BaseComponent) SetPostValue(value string)

func (*BaseComponent) SetSelfClosing added in v0.0.2

func (bc *BaseComponent) SetSelfClosing(value bool)

func (*BaseComponent) SetTag

func (bc *BaseComponent) SetTag(tag string)

func (*BaseComponent) SetValue added in v0.0.2

func (bc *BaseComponent) SetValue(value string)

type Component

type Component interface {
	GetId() string
	GetKey() string
	SetKey(string)
	GetTag() string
	SetTag(string)
	SetParent(c Component)
	GetParent() Component
	GetChildren() map[string]Component
	GetChildrenList() []Component
	HasChildren() bool
	SetChild(key string, child Component)
	GetChild(key string) Component
	AddChild(child Component)
	SetProperty(key string, value interface{})
	SetPropertyWithId(id string, key string, value interface{})
	Render() string
	OnMessage(message *Message) Component
	RegisterOnClick(callback interface{}) Component
	SetCallback(key string, callback interface{})
	GetCallback(key string) interface{}
	GetCallbacks() map[string]interface{}
	Callback(event string, args ...interface{}) Component
	Register(c Component)
	SetAttribute(key, value string)
	GetAttribute(key string) string
	GetAttributes() map[string]string
	GetValue() string
	SetValue(value string)
	GetPostValue() string
	SetPostValue(value string)
	IsSelfClosing() bool
	SetSelfClosing(bool)
}

func NewBaseComponent

func NewBaseComponent() Component

func NewComponent

func NewComponent(tag, class, style string) Component

type JsBase

type JsBase struct{}

func (*JsBase) Register

func (bc *JsBase) Register(c Component)

func (*JsBase) SetProperty

func (jb *JsBase) SetProperty(key string, value interface{})

func (*JsBase) SetPropertyWithId

func (bc *JsBase) SetPropertyWithId(id string, key string, value interface{})

type Message

type Message struct {
	From  Component
	To    Component
	Title string
	Value interface{}
}

Jump to

Keyboard shortcuts

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