Add ContainerHorizontal
This commit is contained in:
parent
9b07b21ab5
commit
c5b642cdc8
27
components/layout/container-horizontal.vugu
Normal file
27
components/layout/container-horizontal.vugu
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<div vg-attr='utils.AttributesAppend{AttrMap: c.AttrMap, Classes: "d3c-1685274222"}'>
|
||||||
|
<vg-comp expr="c.DefaultSlot"></vg-comp>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.d3c-1685274222 {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5em;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script type="application/x-go">
|
||||||
|
import (
|
||||||
|
"git.d3nexus.de/Dadido3/D3vugu-components/utils"
|
||||||
|
"github.com/vugu/vugu"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ContainerHorizonal arranges all contained elements in one row.
|
||||||
|
// This can be used to create a menu bar out of buttons.
|
||||||
|
type ContainerHorizontal struct {
|
||||||
|
AttrMap vugu.AttrMap
|
||||||
|
|
||||||
|
DefaultSlot vugu.Builder `vugu:"data"`
|
||||||
|
}
|
||||||
|
</script>
|
62
components/layout/container-horizontal_vgen.go
Normal file
62
components/layout/container-horizontal_vgen.go
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package layout
|
||||||
|
|
||||||
|
// 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/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ContainerHorizonal arranges all contained elements in one row.
|
||||||
|
// This can be used to create a menu bar out of buttons.
|
||||||
|
type ContainerHorizontal struct {
|
||||||
|
AttrMap vugu.AttrMap
|
||||||
|
|
||||||
|
DefaultSlot vugu.Builder `vugu:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ContainerHorizontal) 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
|
||||||
|
vgn.AddAttrList(utils.AttributesAppend{AttrMap: c.AttrMap, Classes: "d3c-1685274222"})
|
||||||
|
{
|
||||||
|
vgparent := vgn
|
||||||
|
_ = vgparent
|
||||||
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
|
||||||
|
vgparent.AppendChild(vgn)
|
||||||
|
{
|
||||||
|
var vgcomp vugu.Builder = c.DefaultSlot
|
||||||
|
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"}
|
||||||
|
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\t.d3c-1685274222 {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 0.5em;\n\t\tmargin: 0.5em 0;\n\t}\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
|
@ -24,7 +24,7 @@
|
|||||||
" <vg-slot name=\"DefaultSlot\">Successful action</vg-slot>\n" +
|
" <vg-slot name=\"DefaultSlot\">Successful action</vg-slot>\n" +
|
||||||
"</input:Button>"' style="margin: 0;"></pre>
|
"</input:Button>"' style="margin: 0;"></pre>
|
||||||
</view:Code>
|
</view:Code>
|
||||||
<div class="flex-container">
|
<layout:ContainerHorizontal>
|
||||||
<input:Button class="d3c-color-success">
|
<input:Button class="d3c-color-success">
|
||||||
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
||||||
<vg-slot name="DefaultSlot">Successful action</vg-slot>
|
<vg-slot name="DefaultSlot">Successful action</vg-slot>
|
||||||
@ -41,8 +41,8 @@
|
|||||||
<vg-slot name="IconSlot"><icons:LWarning></icons:LWarning></vg-slot>
|
<vg-slot name="IconSlot"><icons:LWarning></icons:LWarning></vg-slot>
|
||||||
<vg-slot name="DefaultSlot">Dangerous action</vg-slot>
|
<vg-slot name="DefaultSlot">Dangerous action</vg-slot>
|
||||||
</input:Button>
|
</input:Button>
|
||||||
</div>
|
</layout:ContainerHorizontal>
|
||||||
<div class="flex-container">
|
<layout:ContainerHorizontal>
|
||||||
<input:Button class="d3c-color-success-faded">
|
<input:Button class="d3c-color-success-faded">
|
||||||
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
||||||
<vg-slot name="DefaultSlot">Successful action</vg-slot>
|
<vg-slot name="DefaultSlot">Successful action</vg-slot>
|
||||||
@ -59,46 +59,48 @@
|
|||||||
<vg-slot name="IconSlot"><icons:LWarning></icons:LWarning></vg-slot>
|
<vg-slot name="IconSlot"><icons:LWarning></icons:LWarning></vg-slot>
|
||||||
<vg-slot name="DefaultSlot">Dangerous action</vg-slot>
|
<vg-slot name="DefaultSlot">Dangerous action</vg-slot>
|
||||||
</input:Button>
|
</input:Button>
|
||||||
</div>
|
</layout:ContainerHorizontal>
|
||||||
|
|
||||||
<h2>Tags</h2>
|
<h2>Tags</h2>
|
||||||
<view:Code>
|
<view:Code>
|
||||||
<pre vg-content='"<view:Tag class=\"d3c-color-success\">This was a success</view:Tag>"' style="margin: 0;"></pre>
|
<pre vg-content='"<view:Tag class=\"d3c-color-success\">This was a success</view:Tag>"' style="margin: 0;"></pre>
|
||||||
</view:Code>
|
</view:Code>
|
||||||
<div class="flex-container">
|
<layout:ContainerHorizontal>
|
||||||
<view:Tag class="d3c-color-success">This was a success</view:Tag>
|
<view:Tag class="d3c-color-success">This was a success</view:Tag>
|
||||||
<view:Tag class="d3c-color-attention">Attention needed</view:Tag>
|
<view:Tag class="d3c-color-attention">Attention needed</view:Tag>
|
||||||
<view:Tag class="d3c-color-caution">Warning</view:Tag>
|
<view:Tag class="d3c-color-caution">Warning</view:Tag>
|
||||||
<view:Tag class="d3c-color-critical">Something went wrong</view:Tag>
|
<view:Tag class="d3c-color-critical">Something went wrong</view:Tag>
|
||||||
</div>
|
</layout:ContainerHorizontal>
|
||||||
<div class="flex-container">
|
<layout:ContainerHorizontal>
|
||||||
<view:Tag class="d3c-color-success-faded">This was a success</view:Tag>
|
<view:Tag class="d3c-color-success-faded">This was a success</view:Tag>
|
||||||
<view:Tag class="d3c-color-attention-faded">Attention needed</view:Tag>
|
<view:Tag class="d3c-color-attention-faded">Attention needed</view:Tag>
|
||||||
<view:Tag class="d3c-color-caution-faded">Warning</view:Tag>
|
<view:Tag class="d3c-color-caution-faded">Warning</view:Tag>
|
||||||
<view:Tag class="d3c-color-critical-faded">Something went wrong</view:Tag>
|
<view:Tag class="d3c-color-critical-faded">Something went wrong</view:Tag>
|
||||||
</div>
|
</layout:ContainerHorizontal>
|
||||||
|
|
||||||
<h2>Icons</h2>
|
<h2>Icons</h2>
|
||||||
<p>Icons will use the text color by default, if you need to change their stroke/fill coloring, use the <view:CodeInline>d3c-icon-use-color</view:CodeInline> class.</p>
|
<p>Icons will use the text color by default, if you need to change their stroke/fill coloring, use the <view:CodeInline>d3c-icon-use-color</view:CodeInline> class.</p>
|
||||||
<view:Code>
|
<view:Code>
|
||||||
<pre vg-content='"<icons:LInfoCircle class=\"d3c-color-attention d3c-icon-use-color\"></icons:LInfoCircle>"' style="margin: 0;"></pre>
|
<pre vg-content='"<icons:LInfoCircle class=\"d3c-color-attention d3c-icon-use-color\"></icons:LInfoCircle>"' style="margin: 0;"></pre>
|
||||||
</view:Code>
|
</view:Code>
|
||||||
<div class="flex-container" style="font-size: 2em;">
|
<layout:ContainerHorizontal style="font-size: 2em;">
|
||||||
<icons:LInfoCircle class="d3c-color-attention d3c-icon-use-color"></icons:LInfoCircle>
|
<icons:LInfoCircle class="d3c-color-attention d3c-icon-use-color"></icons:LInfoCircle>
|
||||||
<icons:LWarning class="d3c-color-critical d3c-icon-use-color"></icons:LWarning>
|
<icons:LWarning class="d3c-color-critical d3c-icon-use-color"></icons:LWarning>
|
||||||
</div>
|
</layout:ContainerHorizontal>
|
||||||
|
|
||||||
<h2>Containers</h2>
|
<h2>Containers</h2>
|
||||||
<layout:LayerContainer class="d3c-color-layer-1">
|
<layout:LayerContainer class="d3c-color-layer-1">
|
||||||
<span>This container uses the <view:CodeInline class="d3c-color-layer-2">d3c-color-layer-1</view:CodeInline> class. All child elements inherit the color scheme.</span>
|
<span>This container uses the <view:CodeInline class="d3c-color-layer-2">d3c-color-layer-1</view:CodeInline> class. All child elements inherit the color scheme.</span>
|
||||||
<input:Button>
|
<layout:ContainerHorizontal>
|
||||||
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
<input:Button>
|
||||||
<vg-slot name="DefaultSlot">Does inherit color</vg-slot>
|
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
||||||
</input:Button>
|
<vg-slot name="DefaultSlot">Does inherit color</vg-slot>
|
||||||
<input:Button class="d3c-color-layer-0">
|
</input:Button>
|
||||||
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
<input:Button class="d3c-color-layer-0">
|
||||||
<vg-slot name="DefaultSlot">Doesn't inherit color</vg-slot>
|
<vg-slot name="IconSlot"><icons:LPlus></icons:LPlus></vg-slot>
|
||||||
</input:Button>
|
<vg-slot name="DefaultSlot">Doesn't inherit color</vg-slot>
|
||||||
|
</input:Button>
|
||||||
|
</layout:ContainerHorizontal>
|
||||||
</layout:LayerContainer>
|
</layout:LayerContainer>
|
||||||
<layout:LayerContainer class="d3c-color-critical-faded">
|
<layout:LayerContainer class="d3c-color-critical-faded">
|
||||||
<icons:LWarning></icons:LWarning> <span>Something bad happened!</span>
|
<icons:LWarning></icons:LWarning> <span>Something bad happened!</span>
|
||||||
|
1638
page-colors_vgen.go
1638
page-colors_vgen.go
File diff suppressed because it is too large
Load Diff
@ -31,8 +31,10 @@
|
|||||||
" })\n" +
|
" })\n" +
|
||||||
"}"' style="margin: 0;"></pre>
|
"}"' style="margin: 0;"></pre>
|
||||||
</view:Code>
|
</view:Code>
|
||||||
<input:Button @Click="c.handleSimpleToastButton(event)">Open simple toast</input:Button>
|
<layout:ContainerHorizontal>
|
||||||
<input:Button @Click="c.handleWarningToastButton(event)">Open warning toast</input:Button>
|
<input:Button @Click="c.handleSimpleToastButton(event)">Open simple toast</input:Button>
|
||||||
|
<input:Button @Click="c.handleWarningToastButton(event)">Open warning toast</input:Button>
|
||||||
|
</layout:ContainerHorizontal>
|
||||||
<p>A shorter version of this is <view:CodeInline>overlay.ToastMessage</view:CodeInline> which only accepts a message text and a message type which is one of</p>
|
<p>A shorter version of this is <view:CodeInline>overlay.ToastMessage</view:CodeInline> which only accepts a message text and a message type which is one of</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><view:CodeInline>overlay.ToastMessageTypeSuccess</view:CodeInline></li>
|
<li><view:CodeInline>overlay.ToastMessageTypeSuccess</view:CodeInline></li>
|
||||||
|
@ -29,7 +29,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x194F4C7AF2E5A2B0^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x4259B5437ED85B00^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.Container)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.Container)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -60,7 +60,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Overlays are handled by the "}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Overlays are handled by the "}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x3757E78A1B64D645^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x847F13BFC8F180A^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -97,7 +97,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Every page or component that creates overlays has to embed the "}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Every page or component that creates overlays has to embed the "}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xFA080C088DBCE9C9^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x11597539355F8078^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -124,7 +124,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " structure. Your wiring function also needs to set the reference to your "}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " structure. Your wiring function also needs to set the reference to your "}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x629A301362214872^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0xE17ED7F11D89B9CE^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -164,7 +164,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x9A4385E0CAC8E985^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0xDF14E85915FF331E^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -205,7 +205,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xC476BA53145BB281^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x91259EFC8AFAADC7^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -243,7 +243,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xA9AF18688A4172C^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x9E888D62321BFAB^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -281,16 +281,15 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x780A6C984431BEBF^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0xF0ED0ED27EF42994^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*layout.ContainerHorizontal)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
// create new one if needed
|
// create new one if needed
|
||||||
vgcomp = new(input.Button)
|
vgcomp = new(layout.ContainerHorizontal)
|
||||||
vgin.BuildEnv.WireComponent(vgcomp)
|
vgin.BuildEnv.WireComponent(vgcomp)
|
||||||
}
|
}
|
||||||
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
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) {
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
||||||
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
||||||
vgout = &vugu.BuildOut{}
|
vgout = &vugu.BuildOut{}
|
||||||
@ -298,35 +297,63 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgparent := vgn
|
vgparent := vgn
|
||||||
_ = vgparent
|
_ = vgparent
|
||||||
|
|
||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Open simple toast"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
return
|
{
|
||||||
})
|
vgcompKey := vugu.MakeCompKey(0xB1222E40FFE80BA6^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
vgout.Components = append(vgout.Components, vgcomp)
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgn = &vugu.VGNode{Component: vgcomp}
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
||||||
vgparent.AppendChild(vgn)
|
if vgcomp == nil {
|
||||||
}
|
// create new one if needed
|
||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgcomp = new(input.Button)
|
||||||
vgparent.AppendChild(vgn)
|
vgin.BuildEnv.WireComponent(vgcomp)
|
||||||
{
|
}
|
||||||
vgcompKey := vugu.MakeCompKey(0x35E3A47F92F1AAD7^vgin.CurrentPositionHash(), vgiterkey)
|
vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around
|
||||||
// ask BuildEnv for prior instance of this specific component
|
vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.handleSimpleToastButton(event) })
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
vgcomp.DefaultSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
||||||
if vgcomp == nil {
|
vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)}
|
||||||
// create new one if needed
|
vgout = &vugu.BuildOut{}
|
||||||
vgcomp = new(input.Button)
|
vgout.Out = append(vgout.Out, vgn)
|
||||||
vgin.BuildEnv.WireComponent(vgcomp)
|
vgparent := vgn
|
||||||
}
|
_ = vgparent
|
||||||
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"}
|
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(0xB774FA1DAD6A06B1^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)
|
vgparent.AppendChild(vgn)
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
@ -344,7 +371,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "A shorter version of this is "}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "A shorter version of this is "}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xABF3E4A38937C760^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x2008FD3859753FBA^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -386,7 +413,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgparent := vgn
|
vgparent := vgn
|
||||||
_ = vgparent
|
_ = vgparent
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xCB89A1E68B20EA8A^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x4F0C4E3C8478E528^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -419,7 +446,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgparent := vgn
|
vgparent := vgn
|
||||||
_ = vgparent
|
_ = vgparent
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x4A0D1617B8C07161^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0xFF67905442723348^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -452,7 +479,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgparent := vgn
|
vgparent := vgn
|
||||||
_ = vgparent
|
_ = vgparent
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x250710AB16D8A4A7^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x9191C8062B221604^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -485,7 +512,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgparent := vgn
|
vgparent := vgn
|
||||||
_ = vgparent
|
_ = vgparent
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xEDD5787DBA040BA8^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x7285F93CF5D54FFA^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.CodeInline)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -516,7 +543,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0xECE61DAD54EC1354^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0xB141CFD7553FCCCC^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*view.Code)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
@ -550,7 +577,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
|
|||||||
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"}
|
||||||
vgparent.AppendChild(vgn)
|
vgparent.AppendChild(vgn)
|
||||||
{
|
{
|
||||||
vgcompKey := vugu.MakeCompKey(0x50434B1AB4676FD5^vgin.CurrentPositionHash(), vgiterkey)
|
vgcompKey := vugu.MakeCompKey(0x5A0135D77FE2347F^vgin.CurrentPositionHash(), vgiterkey)
|
||||||
// ask BuildEnv for prior instance of this specific component
|
// ask BuildEnv for prior instance of this specific component
|
||||||
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button)
|
||||||
if vgcomp == nil {
|
if vgcomp == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user