2023-05-08 18:43:07 +00:00
|
|
|
package navigation
|
|
|
|
|
|
|
|
// 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 (
|
2023-05-08 19:14:55 +00:00
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/input"
|
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/icons"
|
2023-05-15 06:58:12 +00:00
|
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/utils"
|
2023-05-08 18:43:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|
|
|
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
|
|
|
|
var vgiterkey interface{}
|
|
|
|
_ = vgiterkey
|
|
|
|
var vgn *vugu.VGNode
|
2023-05-15 06:58:12 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
2023-05-08 18:43:07 +00:00
|
|
|
vgout.Out = append(vgout.Out, vgn) // root for output
|
2023-05-15 06:58:12 +00:00
|
|
|
vgn.AddAttrList(utils.AttributesAppend{AttrMap: c.AttrMap, Classes: "d3c-1633357633"})
|
2023-05-08 18:43:07 +00:00
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-12 10:57:42 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
|
2023-05-08 18:43:07 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn.AddAttrInterface("class", "d3c-1633357633-sidebar d3c-button-borderless d3c-color-layer-1 "+c.sidebarClasses)
|
2023-05-08 18:43:07 +00:00
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-12 10:57:42 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-sidebar-menu"}}}
|
2023-05-08 18:43:07 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgcompKey := vugu.MakeCompKey(0xF056B7F7D7F7A2C6^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
|
2023-05-12 10:57:42 +00:00
|
|
|
vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.handleMenuButton(event) })
|
2023-05-25 13:59:13 +00:00
|
|
|
vgcomp.IconSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
2023-05-08 18:43:07 +00:00
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
{
|
|
|
|
vgcompKey := vugu.MakeCompKey(0x2C2D8D3889E31C6A^vgin.CurrentPositionHash(), vgiterkey)
|
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobalNav)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LGlobalNav)
|
|
|
|
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
|
|
|
|
})
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-05-12 10:57:42 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
var vgcomp vugu.Builder = c.MenuEntries
|
|
|
|
if vgcomp != nil {
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
vgout.Components = append(vgout.Components, vgcomp)
|
|
|
|
vgn = &vugu.VGNode{Component: vgcomp}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
}
|
2023-05-08 18:43:07 +00:00
|
|
|
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)
|
2023-05-12 10:57:42 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-sidebar-entries"}}}
|
2023-05-08 18:43:07 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
var vgcomp vugu.Builder = c.Entries
|
|
|
|
if vgcomp != nil {
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
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)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-spacer"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn.SetInnerHTML(vugu.HTML(""))
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-15 09:24:25 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-bottom-entries"}}}
|
2023-05-08 18:43:07 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
var vgcomp vugu.Builder = c.BottomEntries
|
|
|
|
if vgcomp != nil {
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
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"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\n\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-body"}}}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-18 15:46:33 +00:00
|
|
|
if c.showBodyOverlay {
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-body-overlay"}}}
|
2023-05-18 13:48:19 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-18 15:46:33 +00:00
|
|
|
vgn.DOMEventHandlerSpecList = append(vgn.DOMEventHandlerSpecList, vugu.DOMEventHandlerSpec{
|
|
|
|
EventType: "click",
|
|
|
|
Func: func(event vugu.DOMEvent) { c.handleOverlayClick(event) },
|
|
|
|
// TODO: implement capture, etc. mostly need to decide syntax
|
|
|
|
})
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
}
|
2023-05-18 13:48:19 +00:00
|
|
|
}
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
2023-05-25 15:44:44 +00:00
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-menu d3c-button-borderless d3c-color-layer-1"}}}
|
2023-05-12 10:57:42 +00:00
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
|
|
|
vgparent.AppendChild(vgn)
|
|
|
|
{
|
|
|
|
vgcompKey := vugu.MakeCompKey(0x897F172FEE13D43B^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.handleMenuButton(event) })
|
2023-05-25 13:59:13 +00:00
|
|
|
vgcomp.IconSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
2023-05-12 10:57:42 +00:00
|
|
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
|
|
|
vgout = &vugu.BuildOut{}
|
|
|
|
vgout.Out = append(vgout.Out, vgn)
|
|
|
|
vgparent := vgn
|
|
|
|
_ = vgparent
|
|
|
|
|
|
|
|
{
|
|
|
|
vgcompKey := vugu.MakeCompKey(0x518FFA1C483DB64B^vgin.CurrentPositionHash(), vgiterkey)
|
|
|
|
// ask BuildEnv for prior instance of this specific component
|
|
|
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobalNav)
|
|
|
|
if vgcomp == nil {
|
|
|
|
// create new one if needed
|
|
|
|
vgcomp = new(icons.LGlobalNav)
|
|
|
|
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
|
|
|
|
})
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
var vgcomp vugu.Builder = c.MenuEntries
|
|
|
|
if vgcomp != nil {
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
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)
|
2023-05-08 18:43:07 +00:00
|
|
|
{
|
|
|
|
var vgcomp vugu.Builder = c.Body
|
|
|
|
if vgcomp != nil {
|
|
|
|
vgin.BuildEnv.WireComponent(vgcomp)
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
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)}
|
|
|
|
{
|
2023-05-18 15:46:33 +00:00
|
|
|
vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t.d3c-1633357633 {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t\tbackground-color: var(--d3c-color-background);\n\t\tcolor: var(--d3c-color-text);\n\t}\n\n\t.d3c-1633357633-menu {\n\t\twidth: 100%;\n\t\tborder-bottom: 1px solid var(--d3c-color-border);\n\t\tdisplay: flex;\n\t\tposition: relative;\n\t\tgap: 0.5em;\n\t\tpadding: 0 0.5em;\n\t\tbox-sizing: border-box;\n\t\tbackground-color: var(--d3c-color-background);\n\t\tcolor: var(--d3c-color-text);\n\t}\n\n\t.d3c-1633357633-sidebar {\n\t\theight: 100%;\n\t\tborder-right: 1px solid var(--d3c-color-border);\n\t\tpadding: 0 0.5em;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tbackground-color: var(--d3c-color-background);\n\t\tcolor: var(--d3c-color-text);\n\t\tz-index: 1;\n\t}\n\n\t.d3c-1633357633-sidebar-menu {\n\t\t/*display: flex;\n\t\tflex-direction: column;*/\n\t}\n\n\t@media (min-aspect-ratio: 1/1) {\n\t\t.d3c-1633357633-menu, .d3c-1633357633-body-overlay {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media not all and (min-aspect-ratio: 1/1) {\n\t\t.d3c-1633357633-sidebar-minimized {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.d3c-1633357633-sidebar {\n\t\t\tposition: absolute;\n\t\t}\n\t}\n\n\t.d3c-1633357633-sidebar-entries {\n\t\toverflow-y: scroll;\n\t}\n\n\t.d3c-1633357633-sidebar-entries > * {\n\t\twidth: 100%;\n\t}\n\n\t.d3c-1633357633-bottom-entries > * {\n\t\twidth: 100%;\n\t}\n\n\t.d3c-1633357633-spacer {\n\t\tflex-grow: 1;\n\t}\n\n\t.d3c-1633357633-body {\n\t\toverflow: auto;\n\t\tflex-grow: 1;\n\t\tflex-shrink: 1;\n\t}\n\n\t.d3c-1633357633-body-overlay {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: fixed;\n\t\t/*backdrop-filter: blur(1px);*/\n\t}\n", Attr: []vugu.VGAttribute(nil)})
|
2023-05-08 18:43:07 +00:00
|
|
|
}
|
|
|
|
vgout.AppendCSS(vgn)
|
|
|
|
return vgout
|
|
|
|
}
|
|
|
|
|
|
|
|
// 'fix' unused imports
|
|
|
|
var _ fmt.Stringer
|
|
|
|
var _ reflect.Type
|
|
|
|
var _ vjson.RawMessage
|
|
|
|
var _ js.Value
|