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) { vgcompKey := vugu.MakeCompKey(0xD91683A9B73577EE^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x5B30FCAD26739F63^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x6B9DB7F6B53653AE^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0xF288C6CA8AD20954^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x3B4A927BBE7A1799^vgin.CurrentPositionHash(), vgiterkey) // 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("
") 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) { vgcompKey := vugu.MakeCompKey(0x90DA35C1900DEDC8^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x4D711FE64E9739F8^vgin.CurrentPositionHash(), vgiterkey) // 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("\n" + " \n" + "
Some text
\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) { vgcompKey := vugu.MakeCompKey(0x765CC91E21B26780^vgin.CurrentPositionHash(), vgiterkey) // 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 { vgcompKey := vugu.MakeCompKey(0x406B98FE10679DEC^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x61B658093D9F2480^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x223C6A258C851839^vgin.CurrentPositionHash(), vgiterkey) // 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("\n" + " \n" + "
Something
\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) { vgcompKey := vugu.MakeCompKey(0x262D746787D635F5^vgin.CurrentPositionHash(), vgiterkey) // 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 { vgcompKey := vugu.MakeCompKey(0x1D5E2D2D1DC8E22B^vgin.CurrentPositionHash(), vgiterkey) // 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) } 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("Buttons can be bound to boolean variables, in this case they will function as a toggle:")) vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { vgcompKey := vugu.MakeCompKey(0x166575EBA57E5395^vgin.CurrentPositionHash(), vgiterkey) // 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("Toggle me!") 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) { vgcompKey := vugu.MakeCompKey(0xE099A60747E10D04^vgin.CurrentPositionHash(), vgiterkey) // 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)) 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("Radio buttons")) vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { vgcompKey := vugu.MakeCompKey(0xD69BB61B7D6C0736^vgin.CurrentPositionHash(), vgiterkey) // 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("\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) { vgcompKey := vugu.MakeCompKey(0x2B23448F4992967D^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x242A69A41C22FD77^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0xB3591D43765CE4A6^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x356F69A257F5FFAC^vgin.CurrentPositionHash(), vgiterkey) // 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("\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) { vgcompKey := vugu.MakeCompKey(0xB4DC6B64ABA54579^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0x8E823C6B52892653^vgin.CurrentPositionHash(), vgiterkey) // 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) 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) 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) { vgcompKey := vugu.MakeCompKey(0x8A395E3190C3BB17^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0xDCC83ED7EF6D2B07^vgin.CurrentPositionHash(), vgiterkey) // 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("\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: "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) { vgcompKey := vugu.MakeCompKey(0x3C5D37BC91592864^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.inputField1String} vgcomp.ID = "page-input-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("Current value is %q.", c.inputField1String)) 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) { vgcompKey := vugu.MakeCompKey(0xAD10FB81C6E8DBC6^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.inputField2Int} vgcomp.ID = "page-input-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: "span", Attr: []vugu.VGAttribute(nil)} vgparent.AppendChild(vgn) vgn.SetInnerHTML(fmt.Sprintf("Current value is %v.", c.inputField2Int)) 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) { vgcompKey := vugu.MakeCompKey(0x2227DAD00DA77ED^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.inputField3Float} vgcomp.ID = "page-input-3" 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 value is %v.", c.inputField3Float)) 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-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) { vgcompKey := vugu.MakeCompKey(0x9C29CAB437462211^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.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) 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: "For passwords you have to use the "} vgparent.AppendChild(vgn) { vgcompKey := vugu.MakeCompKey(0xE03E10C30B31DCAE^vgin.CurrentPositionHash(), vgiterkey) // 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: "input.FieldBindPassword"} 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: " binder:"} 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) { vgcompKey := vugu.MakeCompKey(0xF80E7959999F9A6E^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.FieldBindPassword{&c.inputField4String} vgcomp.ID = "page-input-4" 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("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) { vgcompKey := vugu.MakeCompKey(0x24D83BEE34C19455^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.inputField5String} vgcomp.ID = "page-input-5" 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) { vgcompKey := vugu.MakeCompKey(0x4C793F71A9D72212^vgin.CurrentPositionHash(), vgiterkey) // 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 { { vgcompKey := vugu.MakeCompKey(0xDBC6A1964C3AAB4E^vgin.CurrentPositionHash(), vgiterkey) // 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 { { vgcompKey := vugu.MakeCompKey(0xADC3EACF8D017D8^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0xAAE16992DDE3F2B4^vgin.CurrentPositionHash(), vgiterkey) // 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) { vgcompKey := vugu.MakeCompKey(0xF4E25069180419AB^vgin.CurrentPositionHash(), vgiterkey) // 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) } 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) { vgcompKey := vugu.MakeCompKey(0xA8B644EE4371B847^vgin.CurrentPositionHash(), vgiterkey) // 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} vgcomp.BindList = input.ListBindGenericSlice[string]{Slice: &c.dropdown1Slice} 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)) 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) { vgcompKey := vugu.MakeCompKey(0x13F92885BE084412^vgin.CurrentPositionHash(), vgiterkey) // 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) } vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\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"} 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