836 lines
36 KiB
Go
836 lines
36 KiB
Go
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/view"
|
|
)
|
|
|
|
func (c *PageOverlays) 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(0x6122140AA7970454^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("Overlays"))
|
|
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: "Overlays are handled by the "}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x1B9CC39770823BF5^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: "overlay.Container"}
|
|
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: " component which has to be embedded into your root component."}
|
|
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: "Every page or component that creates overlays has to embed the "}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x5A00C43B8907AA2A^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: "overlay.OverlayContainerRef"}
|
|
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: " structure. Your wiring function also needs to set the reference to your "}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xFBC0CBC5ECD097E3^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: "overlay.Container"}
|
|
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: " that you have placed in your root component."}
|
|
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("Modals"))
|
|
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("A simple requester modal is already contained in the overlay package. Use it with:"))
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xB6D21A4B8525BB8B^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 *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.SetModal(&overlay.ModalRequester{\n" +
|
|
" IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{\"style\": \"font-size: 2em;\"}},\n" +
|
|
" Title: \"Simple requester\",\n" +
|
|
" Message: \"This is a simple modal requester, are you happy with it?\\nIt also supports multi line text!\",\n" +
|
|
" SignalColor: \"d3c-color-accent\",\n" +
|
|
" ClickAbort: input.ClickFunc(func(event input.ClickEvent) {}),\n" +
|
|
" ClickYes: input.ClickFunc(func(event input.ClickEvent) {}),\n" +
|
|
" })\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(0xDBC72B8B2CD6DEC6^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.handleSimpleModalButton(event) })
|
|
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: "Open simple modal"}
|
|
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("Toasts"))
|
|
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("A simple toast with an icon slot and custom color setting can be found in the overlay package. Use it with:"))
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x63C4F75486DED1E9^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 *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.AddToast(event, &overlay.ToastSimple{\n" +
|
|
" IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{\"style\": \"font-size: 2em;\"}},\n" +
|
|
" Message: \"This is a simple toast!\\nIt supports multiple lines and has an icon slot.\\nThere also can be multiple of it at the same time, this one was opened at \" + time.Now().Format(time.TimeOnly) + \".\",\n" +
|
|
" SignalColor: \"d3c-color-accent\",\n" +
|
|
" })\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(0xF0ED0ED27EF42994^vgin.CurrentPositionHash(), vgiterkey)
|
|
// ask BuildEnv for prior instance of this specific component
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.ContainerHorizontal)
|
|
if vgcomp == nil {
|
|
// create new one if needed
|
|
vgcomp = new(layout.ContainerHorizontal)
|
|
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)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xA4081932846E05D1^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.handleSimpleToastButton(event) })
|
|
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: "Open simple toast"}
|
|
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(0xF867B04EF9CAB93D^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.handleWarningToastButton(event) })
|
|
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: "Open warning toast"}
|
|
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\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: "A shorter version of this is "}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x18470969C6AFC448^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: "overlay.ToastMessage"}
|
|
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: " which only accepts a message text and a message type which is one of"}
|
|
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: "ul", Attr: []vugu.VGAttribute(nil)}
|
|
vgparent.AppendChild(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: "li", Attr: []vugu.VGAttribute(nil)}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgparent := vgn
|
|
_ = vgparent
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x2D884CCCED60ED30^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: "overlay.ToastMessageTypeSuccess"}
|
|
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)
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "li", Attr: []vugu.VGAttribute(nil)}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgparent := vgn
|
|
_ = vgparent
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xCA36BD2A0004F7B1^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: "overlay.ToastMessageTypeAttention"}
|
|
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)
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "li", Attr: []vugu.VGAttribute(nil)}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgparent := vgn
|
|
_ = vgparent
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x86FB3ECC963617F^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: "overlay.ToastMessageTypeCaution"}
|
|
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)
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "li", Attr: []vugu.VGAttribute(nil)}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgparent := vgn
|
|
_ = vgparent
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x75545EEE368E88F1^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: "overlay.ToastMessageTypeCritical"}
|
|
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(1), Data: "\n\t\t"}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xD4553E3A6B4CDAC5^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 *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.AddToast(event.EventEnv(), &overlay.ToastMessage{MessageType: overlay.ToastMessageTypeCritical, Message: \"Uh oh!\"})\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(0x8893AD0E010D9420^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.handleToastMessageButton(event) })
|
|
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: "Open message toast"}
|
|
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: "To let the toast close itself after some time, you can use the "}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x984905AE566E7226^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: "Duration"}
|
|
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: " option:"}
|
|
vgparent.AppendChild(vgn)
|
|
}
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x170E6B6004248D96^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 *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.AddToast(event.EventEnv(), &overlay.ToastMessage{MessageType: overlay.ToastMessageTypeSuccess, Message: \"That worked!\", Duration: 5 * time.Second})\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(0x14E84F6F0F2D45AC^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.handleToastMessageTimeoutButton(event) })
|
|
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: "Open self closing message toast"}
|
|
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("Wait/Load overlay"))
|
|
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("For actions that take a bit longer you can show the wait overlay:"))
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
vgparent.AppendChild(vgn)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0x9C5F61CA0305F660^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 *PageOverlays) handleWaitOverlayButton(event vugu.DOMEvent) {\n" +
|
|
" c.WaitOverlayOpen()\n" +
|
|
" go func() {\n" +
|
|
" // Simulate some request or some other action.\n" +
|
|
" time.Sleep(5 * time.Second)\n" +
|
|
" // We need to lock and unlock the event environment in order for the DOM to re-render and the overlay to disappear correctly.\n" +
|
|
" event.EventEnv().Lock()\n" +
|
|
" defer event.EventEnv().UnlockRender()\n" +
|
|
" defer c.WaitOverlayDone() // WaitOverlayDone has to be called before UnlockRender, so we need to put it afterwards (defer ordering).\n" +
|
|
" // Update other UI stuff here.\n" +
|
|
" }()\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(0x2E51C28B04B3A7CF^vgin.CurrentPositionHash(), vgiterkey)
|
|
// ask BuildEnv for prior instance of this specific component
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.ContainerHorizontal)
|
|
if vgcomp == nil {
|
|
// create new one if needed
|
|
vgcomp = new(layout.ContainerHorizontal)
|
|
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)
|
|
{
|
|
vgcompKey := vugu.MakeCompKey(0xC9431316B96BAF61^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.handleWaitOverlayButton(event) })
|
|
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: "Do some action that takes time"}
|
|
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\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
|