2023-05-25 13:59:13 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// Code generated by vugu via vugugen. Please regenerate instead of editing or add additional code in a separate file. DO NOT EDIT.
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
import "reflect"
|
|
|
|
import "github.com/vugu/vjson"
|
|
|
|
import "github.com/vugu/vugu"
|
|
|
|
import js "github.com/vugu/vugu/js"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/input"
|
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/layout"
|
|
|
|
//"git.d3nexus.de/Dadido3/D3vugu-components/components/navigation"
|
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/view"
|
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/icons"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (c *PageInput) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
|
|
|
|
var vgiterkey interface{}
|
|
|
|
_ = vgiterkey
|
|
|
|
var vgn *vugu.VGNode
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgout.Out = append(vgout.Out, vgn) // root for output
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x947E59975927A2FA^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.Container)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(layout.Container)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h1", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Input"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Clickable components support the "}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x824C52E34196E77B^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.CodeInline)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "EventClick"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " event that handlers can be registered to with "}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x1C2AEAAE2BF6AC5D^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.CodeInline)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "@Click=\"c.handleButton(event)\""}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x8DE76775758803E2^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("func (c *PageInput) handleButton(event input.ClickEvent) {\n" +
|
|
|
|
" c.button1Counter++\n" +
|
|
|
|
"}")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Data binding..."))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Button"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Simple example with click handler:"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xD27F30849E3672E1^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<input:Button @Click=\"c.button1Counter++\"><div vg-content=\"fmt.Sprintf(`Button pressed %d times`, c.button1Counter)\"></div></input:Button>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xA9A8932C9AC636EF^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.button1Counter++ })
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Button pressed %d times", c.button1Counter))
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Symbols can be attached to buttons:"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xC36240073896AE95^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<input:Button>\n" +
|
|
|
|
" <vg-slot name=\"IconSlot\"><icons:LDocument></icons:LDocument></vg-slot>\n" +
|
|
|
|
" <vg-slot name=\"DefaultSlot\"><div>Some text</div></vg-slot>\n" +
|
|
|
|
"</input:Button>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x326A82D46D6396B5^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.IconSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x661B486FF158FF42^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocument)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LDocument)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Some text"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Use the "}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x478FDC954C3EA46A^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.CodeInline)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "d3c-button-vertical"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " CSS class to align the button content vertically:"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x2AAD47A3AC92D246^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<input:Button class=\"d3c-button-vertical\">\n" +
|
|
|
|
" <vg-slot name=\"IconSlot\"><icons:LGlobe style=\"font-size: 2em;\"></icons:LGlobe></vg-slot>\n" +
|
|
|
|
" <vg-slot name=\"DefaultSlot\"><div>Something</div></vg-slot>\n" +
|
|
|
|
"</input:Button>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xCA3AD48273BB2C2^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["class"] = "d3c-button-vertical"
|
|
|
|
vgcomp.IconSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9AB7DAADBB8288FB^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobe)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LGlobe)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["style"] = "font-size: 2em;"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Something"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-05-25 14:37:46 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:20:12 +00:00
|
|
|
vgn.SetInnerHTML(vugu.HTML("Buttons can be bound to boolean variables, in this case they will function as a toggle:"))
|
2023-05-25 14:37:46 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xD647D90A51CE1F3E^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 14:37:46 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<input:Button :Bind=\"&c.button4Bool\">Toggle me!</input:Button>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xCB770C0F1AE8C291^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 14:37:46 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = &c.button4Bool
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Toggle me!"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf(`Boolean is set to %v.`, c.button4Bool))
|
2023-05-25 13:59:13 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-06-23 18:41:04 +00:00
|
|
|
vgn.SetInnerHTML(vugu.HTML("Radio buttons"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xEFB4944BDA615838^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-07-02 22:18:58 +00:00
|
|
|
vgn.SetInnerHTML("<input:RadioButton id=\"page-radio-button-1-a\" :Bind=\"input.ValueBindAny{&c.radioButton1}\" Key=\"A\"></input:RadioButton>\n" +
|
2023-06-23 18:41:04 +00:00
|
|
|
"<label for=\"page-radio-button-1-a\">Option A</label>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x7BC2310B4750C527^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.RadioButton)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.RadioButton)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.radioButton1}
|
2023-06-23 18:41:04 +00:00
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-radio-button-1-a"
|
|
|
|
vgcomp.Key = "A"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-radio-button-1-a"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Option A"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "br", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xE1EDD1866AE78AC6^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.RadioButton)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.RadioButton)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.radioButton1}
|
2023-06-23 18:41:04 +00:00
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-radio-button-1-b"
|
|
|
|
vgcomp.Key = "B"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-radio-button-1-b"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Option B"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "br", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x756E5CE8DE4E165B^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.RadioButton)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.RadioButton)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.radioButton1}
|
2023-06-23 18:41:04 +00:00
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-radio-button-1-c"
|
|
|
|
vgcomp.Key = "C"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-radio-button-1-c"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Option C"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf(`Selected option is %q.`, c.radioButton1))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Checkboxes"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x333BDCEE368C3E1A^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<input:CheckBox id=\"page-checkBox-1\" :Bind=\"&c.checkBox1\"></input:CheckBox>\n" +
|
|
|
|
"<label for=\"page-checkBox-1\">Click this to toggle the checkBox</label>")
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x4F1AC3C7FF3C105^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.CheckBox)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.CheckBox)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = &c.checkBox1
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-checkBox-1"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-checkBox-1"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Click this to toggle the checkbox"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf(`Boolean is set to %v.`, c.checkBox1))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x500C0F57C116FDE6^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.CheckBox)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.CheckBox)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = &c.checkBox2
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-checkBox-2"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-checkBox-2"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Click this to toggle the pre-checked checkbox"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 13:59:13 +00:00
|
|
|
vgn.SetInnerHTML(vugu.HTML("Input fields"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Input fields can be bound to data. They will automatically change their type based on the bound data type."))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-06-04 15:45:27 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "To make labels work correctly, you have to use the "}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xAC7E753F72CE5326^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-04 15:45:27 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.CodeInline)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "ID=\"some-id\""}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " tag (uppercase ID), which will set the ID of the embedded input element!"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 13:59:13 +00:00
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9A3BC016AC5CAC3E^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.Code)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "style", Val: "margin: 0;"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML("<label for=\"page-input-1\">Some input field</label>\n" +
|
2023-07-02 22:18:58 +00:00
|
|
|
"<input:Field ID=\"page-input-1\" :Bind=\"input.ValueBindAny{&c.inputField1String}\"></input:Field>")
|
2023-05-25 13:59:13 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-1"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to string value"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x2D043AD37AA3D919^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField1String}
|
2023-06-04 15:45:27 +00:00
|
|
|
vgcomp.ID = "page-input-1"
|
2023-05-25 13:59:13 +00:00
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Current value is %q.", c.inputField1String))
|
2023-05-25 13:59:13 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "br", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-2"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to integer value"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x48774E335A6DF07E^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField2Int}
|
2023-06-04 15:45:27 +00:00
|
|
|
vgcomp.ID = "page-input-2"
|
2023-05-25 13:59:13 +00:00
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Current value is %v.", c.inputField2Int))
|
2023-05-25 13:59:13 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "br", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-3"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to float value"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x389F24DDC5168BE1^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 13:59:13 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField3Float}
|
2023-06-04 15:45:27 +00:00
|
|
|
vgcomp.ID = "page-input-3"
|
2023-05-25 13:59:13 +00:00
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Current value is %v.", c.inputField3Float))
|
2023-05-25 15:20:12 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-06-23 18:41:04 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "br", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-6"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to bool value"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xB72B704D381BCEA4^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 18:41:04 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField6Bool}
|
2023-06-23 18:41:04 +00:00
|
|
|
vgcomp.ID = "page-input-6"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Current state is %v.", c.inputField6Bool))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:20:12 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
2023-06-23 19:10:35 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "For passwords you have to set the "}
|
2023-05-25 15:20:12 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xB95F701A0781923E^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:20:12 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(view.CodeInline)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
2023-06-23 19:10:35 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Type=\"password\""}
|
2023-05-25 15:20:12 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-06-23 19:10:35 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " field of the component:"}
|
2023-05-25 15:20:12 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-4"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to password string"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x7AF4AD884531BF03^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:20:12 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField4String}
|
2023-06-04 15:45:27 +00:00
|
|
|
vgcomp.ID = "page-input-4"
|
2023-06-23 19:10:35 +00:00
|
|
|
vgcomp.Type = "password"
|
2023-05-25 15:20:12 +00:00
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Secret password is %q.", c.inputField4String))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("You can add additional buttons to the input field:"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-5"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field with some extra button"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9D7C1AD758CE42B7^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField5String}
|
2023-06-04 15:45:27 +00:00
|
|
|
vgcomp.ID = "page-input-5"
|
2023-05-25 15:44:44 +00:00
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x555BD39E45783FEE^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = &c.inputField5Bool
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
if !c.inputField5Bool {
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x455A78C33C3AD4EA^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLockOpened)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LLockOpened)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["class"] = "d3c-button-borderless"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
if c.inputField5Bool {
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9A1CDBA3EA679202^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLockClosed)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LLockClosed)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["class"] = "d3c-button-borderless"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xC261560825261918^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Button)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xE28D137A80B46A63^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-25 15:44:44 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobe)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LGlobe)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-06-23 19:10:35 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("time.Time is also supported:"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-input-7"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Some input field bound to a time.Time value"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x7D6DE54C774B51C4^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-23 19:10:35 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Field)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Field)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{&c.inputField7Time}
|
2023-06-23 19:10:35 +00:00
|
|
|
vgcomp.ID = "page-input-7"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Selected date and time is %v.", c.inputField7Time))
|
2023-05-27 11:37:40 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Drop-down"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "label", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "for", Val: "page-dropdown-1"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Select a slice entry"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xC3DF5DFFB763B333^vgin.CurrentPositionHash(), vgiterkey)
|
2023-05-27 11:37:40 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Dropdown)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Dropdown)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.Bind = input.ValueBindAny{Value: &c.dropdown1Index}
|
2023-06-02 09:17:22 +00:00
|
|
|
vgcomp.BindList = input.ListBindGenericSlice[string]{Slice: &c.dropdown1Slice}
|
2023-05-27 11:37:40 +00:00
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-dropdown-1"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "span", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("The selected index is %d.", c.dropdown1Index))
|
2023-06-02 09:17:22 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Tags"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "p", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Select or change the list of tags"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9B60AFD947AFFD5B^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-02 09:17:22 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Tags)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.Tags)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = input.ListBindGenericSlice[string]{Slice: &c.tags1Slice}
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-tags-1"
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-06-26 22:23:07 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "h2", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML("Text-area"))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x5BD5B3B75FBAF631^vgin.CurrentPositionHash(), vgiterkey)
|
2023-06-26 22:23:07 +00:00
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.TextArea)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(input.TextArea)
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
}
|
|
|
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
|
|
|
vgcomp.Bind = &c.textArea1
|
|
|
|
vgcomp.AttrMap = make(map[string]interface{}, 8)
|
|
|
|
vgcomp.AttrMap["id"] = "page-text-area-1"
|
|
|
|
vgcomp.AttrMap["rows"] = "10"
|
2023-07-02 22:18:58 +00:00
|
|
|
vgcomp.AttrMap["style"] = "width:100%; resize:none; box-sizing:border-box;"
|
2023-06-26 22:23:07 +00:00
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "pre", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(fmt.Sprintf("Your entered text: %s", c.textArea1))
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t"}
|
2023-05-25 13:59:13 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
return
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "style", Attr: []vugu.VGAttribute(nil)}
|
|
|
|
{
|
|
|
|
vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n", Attr: []vugu.VGAttribute(nil)})
|
|
|
|
}
|
|
|
|
vgout.AppendCSS(vgn)
|
|
|
|
return vgout
|
|
|
|
}
|
|
|
|
|
|
|
|
// 'fix' unused imports
|
|
|
|
var _ fmt.Stringer
|
|
|
|
var _ reflect.Type
|
|
|
|
var _ vjson.RawMessage
|
|
|
|
var _ js.Value
|