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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xA7BF38F7A4F15FB1^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x1BBFCEE5ECF27786^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x76DA5A4D7ABA2079^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x2E1D3AB39AD10144^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9726746926D8210F^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xCBD014406ABD8E7F^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x138295FF6DF1D969^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xAE9BFD565BC46B08^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x52BE6DBBEDC24298^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xA5E3450E097417E6^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x16924E989032F15B^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xD97E450127BB784C^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x33BAEA5D3DC63B9E^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x31C77D55E912FB04^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9E08C767F104F536^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xF3FCB1DBB43CD672^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:RadioButton id=\"page-radio-button-1-a\" :Bind=\"input.FieldBindAny{&c.radioButton1}\" Key=\"A\"></input:RadioButton>\n" +
|
|
|
|
"<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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xF602BFD925DBEE69^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&c.radioButton1}
|
|
|
|
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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x862E0DFB092D8EFC^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&c.radioButton1}
|
|
|
|
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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x8ED0FBD0D48EC151^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&c.radioButton1}
|
|
|
|
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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x25B165A3AE4838B5^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x12B9256A2CAB3523^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x2898350697073FE9^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xC90AD44CF5169056^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x309EA081BB038019^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-06-04 15:45:27 +00:00
|
|
|
"<input:Field ID=\"page-input-1\" :Bind=\"input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xD2B67FE044D91FCE^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-05-25 15:44:44 +00:00
|
|
|
vgcomp.Bind = input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x255F990C3224E008^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-05-25 15:44:44 +00:00
|
|
|
vgcomp.Bind = input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xEF716BA24AC432D4^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-05-25 15:44:44 +00:00
|
|
|
vgcomp.Bind = input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xDBF4B9CBAE332106^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&c.inputField6Bool}
|
|
|
|
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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x9380782AB9F0496F^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xAE94EFCAA96C7B2B^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-06-23 19:10:35 +00:00
|
|
|
vgcomp.Bind = input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xCEB9FF384528CCBB^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x151D017F3E93F8EA^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x564011B2B94AAA09^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x208118A20A66CA35^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0x2D48A2E1FE429FE5^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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xF2109FFEEC226E2F^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)
|
|
|
|
{
|
|
|
|
vgcompKey := vugu.MakeCompKey(0x53FBACB92BF2833B^vgin.CurrentPositionHash(), vgiterkey)
|
|
|
|
// 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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{&c.inputField7Time}
|
|
|
|
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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xDE6670421206A893^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
|
|
|
|
vgcomp.Bind = input.FieldBindAny{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-06-23 19:10:35 +00:00
|
|
|
vgcompKey := vugu.MakeCompKey(0xA5223E429AA7432^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-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
|