From 34780386f6c131729b6a1948a0d51916d5dca578 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Sun, 28 May 2023 16:47:10 +0200 Subject: [PATCH] Add loading overlay - Update overlay example page - Add LLoadingCircle icon - Rename LErrorCircle to LWarningCircle - Change ToastMessageTypeCaution to use LWarningCircle --- component-icons.vugu | 3 +- component-icons_vgen.go | 186 ++++++++++-------- components/overlay/container.go | 22 +++ components/overlay/container.vugu | 21 ++ components/overlay/container_vgen.go | 32 ++- components/overlay/toast-message.vugu | 2 +- components/overlay/toast-message_vgen.go | 8 +- icons/l-loading-circle.vugu | 53 +++++ icons/l-loading-circle_vgen.go | 51 +++++ ...rror-circle.vugu => l-warning-circle.vugu} | 2 +- ...ircle_vgen.go => l-warning-circle_vgen.go} | 4 +- page-overlays.go | 13 ++ page-overlays.vugu | 22 ++- page-overlays_vgen.go | 152 +++++++++++--- 14 files changed, 453 insertions(+), 118 deletions(-) create mode 100644 icons/l-loading-circle.vugu create mode 100644 icons/l-loading-circle_vgen.go rename icons/{l-error-circle.vugu => l-warning-circle.vugu} (96%) rename icons/{l-error-circle_vgen.go => l-warning-circle_vgen.go} (97%) diff --git a/component-icons.vugu b/component-icons.vugu index b983c0c..ad919bc 100644 --- a/component-icons.vugu +++ b/component-icons.vugu @@ -30,7 +30,6 @@ - @@ -39,6 +38,7 @@ + @@ -66,6 +66,7 @@ + diff --git a/component-icons_vgen.go b/component-icons_vgen.go index 7e3681a..8be3cc4 100644 --- a/component-icons_vgen.go +++ b/component-icons_vgen.go @@ -33,7 +33,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x95F6715FA8334771^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xDFDE13A34120739E^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LAccept) if vgcomp == nil { @@ -49,7 +49,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x8F98A983828960E8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xA4A99DEB8ABC6467^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LArrowDown) if vgcomp == nil { @@ -65,7 +65,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xBFF1342F684A76E5^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x3E98B0432F16B356^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LArrowLeft) if vgcomp == nil { @@ -81,7 +81,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x6BB4C546D89B0DD^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xD330161D7FCFBAEC^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LArrowRight) if vgcomp == nil { @@ -97,7 +97,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x6B971FBBCB7576B8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x8FD8B69C04771C5E^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LArrowUp) if vgcomp == nil { @@ -113,7 +113,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2371B9C1AB502465^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xED3F7B9C79EAFCBE^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LBackToWindow) if vgcomp == nil { @@ -129,7 +129,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x8A16FD31A79A7D9C^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x496318AEECC17614^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LBell) if vgcomp == nil { @@ -145,7 +145,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x98F529D3A406EEB0^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xAADCEEE4AA392299^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LBellDisabled) if vgcomp == nil { @@ -161,7 +161,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x6167C96337E9443A^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xC5E74B82974D997A^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCancel) if vgcomp == nil { @@ -177,7 +177,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x6F67AFE3334F9F4C^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xB01D24FC1AB43566^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LChevronDown) if vgcomp == nil { @@ -193,7 +193,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x1ED662C427239432^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x16BE0776F608B6FC^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LChevronLeft) if vgcomp == nil { @@ -209,7 +209,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x3C55118070D6BC8D^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xFFA4289EE084B4BD^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LChevronRight) if vgcomp == nil { @@ -225,7 +225,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x82DD8E52A909262C^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xB881C0A224F6C6B2^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LChevronUp) if vgcomp == nil { @@ -241,7 +241,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x558B17D8C65312AF^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xA4DD444EB318D2F6^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCircleMinus) if vgcomp == nil { @@ -257,7 +257,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x13E9B77E1436FD4E^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x90E48245CDE95F21^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCirclePlus) if vgcomp == nil { @@ -273,7 +273,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x4B8F6EAF9DB0A1F9^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x964614642D66809F^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LClock) if vgcomp == nil { @@ -289,7 +289,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x1F09739880E5907E^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xD0F256A4423CF43B^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCodeTags) if vgcomp == nil { @@ -305,7 +305,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x320F1B075668C151^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x35A4B19075865195^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCodeTagsClosing) if vgcomp == nil { @@ -321,7 +321,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xE92BE5F32B54B376^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x265CAA088AF7ECE2^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCopy) if vgcomp == nil { @@ -337,7 +337,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2BB153641C32D0B6^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x84AC700125A9A125^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCustomize) if vgcomp == nil { @@ -353,7 +353,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x724F101C5119DE0E^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xD020D9D63A4A1D44^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LCut) if vgcomp == nil { @@ -369,7 +369,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x841B78086DA75CEF^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x6FC5BA8D9571E7C1^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDelete) if vgcomp == nil { @@ -385,7 +385,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xC19D15EA0AE2B45E^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x20CC48C4ADB1FAA0^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDeliver) if vgcomp == nil { @@ -401,7 +401,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x5F96E4FA60A4902A^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xA1963C12F02CBA73^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocument) if vgcomp == nil { @@ -417,7 +417,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xA165973D7448C078^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xDDB463F144A8CFA0^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocumentBulletList) if vgcomp == nil { @@ -433,7 +433,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xCB66E096C08F0A1^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x99E081C9F76AC20F^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocumentCheckboxes) if vgcomp == nil { @@ -449,7 +449,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x996E9753A2265CE8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x3B0C424AD733AB5^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocumentRichText) if vgcomp == nil { @@ -465,7 +465,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x18BFFD4E97FCC2A8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x412CA57BAB7FDDF3^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDocumentText) if vgcomp == nil { @@ -481,7 +481,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x5BFDD138C7559C4E^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x5F0E78C71661D985^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LDownload) if vgcomp == nil { @@ -497,7 +497,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x3F071A11ACF6D117^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xF0EA6E227C4ABBBF^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LEdit) if vgcomp == nil { @@ -513,7 +513,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x894922ADA2FA769B^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xA507D44718A5DD5F^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LEllipsis) if vgcomp == nil { @@ -529,23 +529,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xBFBE1740D463A01E^vgin.CurrentPositionHash(), vgiterkey) - // ask BuildEnv for prior instance of this specific component - vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LErrorCircle) - if vgcomp == nil { - // create new one if needed - vgcomp = new(icons.LErrorCircle) - 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"} - vgparent.AppendChild(vgn) - { - vgcompKey := vugu.MakeCompKey(0xFBC1D05439D80D09^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x2C7326B378100002^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LFilter) if vgcomp == nil { @@ -561,7 +545,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xF6A570BDCFAE22E3^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xACC51CF188BD4E8B^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LFullScreen) if vgcomp == nil { @@ -577,7 +561,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x120419A6EA2709CB^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x9DCF1D62D9CE7862^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobalNav) if vgcomp == nil { @@ -593,7 +577,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xC1918C95EFF3271F^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x26FE5BEF48EE857B^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobe) if vgcomp == nil { @@ -609,7 +593,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x20857ADDCA63EC13^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xE00757F8121F0B9D^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LHome) if vgcomp == nil { @@ -625,7 +609,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x7F91580101E260D6^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x3348C39F38C0DD00^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LHourglass) if vgcomp == nil { @@ -641,7 +625,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x822F3BA5431775B1^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x9BF468CDD4C0EE57^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LInfoCircle) if vgcomp == nil { @@ -657,7 +641,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xE7DA76178599078A^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x20D7E129C01BEC84^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LInputField) if vgcomp == nil { @@ -673,7 +657,23 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xDD9959BEC9A1BF35^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xBF4AA0CD564D5A14^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLoadingCircle) + if vgcomp == nil { + // create new one if needed + vgcomp = new(icons.LLoadingCircle) + 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"} + vgparent.AppendChild(vgn) + { + vgcompKey := vugu.MakeCompKey(0xA0A0C35F560CA5B8^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLockClosed) if vgcomp == nil { @@ -689,7 +689,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xE1F0922E17A2DFB8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x4D1DEDEE72261588^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLockDisabled) if vgcomp == nil { @@ -705,7 +705,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x927AD75D5EEF022^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x69D94D03D081079C^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LLockOpened) if vgcomp == nil { @@ -721,7 +721,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xDED91230E5BE0601^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xEE57B69201DDB75F^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LMail) if vgcomp == nil { @@ -737,7 +737,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x29A151C262556137^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xF34049E40EE6A9F6^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LMailOpened) if vgcomp == nil { @@ -753,7 +753,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x44D0A8DA9769D5B^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x92C14EA8EECF16A6^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LMinus) if vgcomp == nil { @@ -769,7 +769,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x198A83D9EDA1CB8B^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xC4F3641D7C418B51^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LMore) if vgcomp == nil { @@ -785,7 +785,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xA0F5F1E589794DD^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xE6F9DFFD10B1DDF6^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LPaste) if vgcomp == nil { @@ -801,7 +801,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xA0CF0E73905F0B04^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xE56B59CF51A1C77B^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LPause) if vgcomp == nil { @@ -817,7 +817,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x229F79AF64929DD^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x5B4AE06896563BFB^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LPlus) if vgcomp == nil { @@ -833,7 +833,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x4A8DF9A36FF8946^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x88EA916C13E361AA^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LPowerButton) if vgcomp == nil { @@ -849,7 +849,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xF32301B037B43529^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xA1B1E11147FE3C43^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LQuestionMark) if vgcomp == nil { @@ -865,7 +865,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x99A6662BB652C8CE^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x2B8CFD406F91944C^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LRedo) if vgcomp == nil { @@ -881,7 +881,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x306DFC1AA5773C1^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x560AC5FCAB4ACB70^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LReload) if vgcomp == nil { @@ -897,7 +897,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xCBAD268E08594825^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x566C64872BC080B9^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LSave) if vgcomp == nil { @@ -913,7 +913,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2E3EAB0A0FE0118^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x12C0A5D580DF7B29^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LSearch) if vgcomp == nil { @@ -929,7 +929,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x7470F324308619BE^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xC6986698E5082964^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LSettings) if vgcomp == nil { @@ -945,7 +945,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x24FE5D41143D4A02^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x27DD2531D73BC51^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LSort) if vgcomp == nil { @@ -961,7 +961,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x524E4520F12D637F^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xBB3723095FCCAC34^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LStar) if vgcomp == nil { @@ -977,7 +977,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x72DC8782861A2857^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x54CA39A2AF8684AD^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LStart) if vgcomp == nil { @@ -993,7 +993,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x3209B38E799A578^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x2AEC982C5FA13775^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LStop) if vgcomp == nil { @@ -1009,7 +1009,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x972BBF1D60A4FB62^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x68D6FE586FEA1150^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LStopWatch) if vgcomp == nil { @@ -1025,7 +1025,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xF706125900B5A6E2^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xAAFD5C58AC2CFB71^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LTodoList) if vgcomp == nil { @@ -1041,7 +1041,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x17C92C294CE43D41^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x1DED8FE0AAA1C92F^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LUndo) if vgcomp == nil { @@ -1057,7 +1057,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x6063D4CDF30E91C8^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x15D6596E05B4671A^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LUpload) if vgcomp == nil { @@ -1073,7 +1073,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x23C1BF1D79F84202^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x7BB834E1D2946D07^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LWarehouse) if vgcomp == nil { @@ -1089,7 +1089,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x10A39BADC857BF7A^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xBF5DD2C4AC53C0B3^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LWarning) if vgcomp == nil { @@ -1105,7 +1105,23 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xF82A98FCC91FB45A^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x46BF577C4FD050EA^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LWarningCircle) + if vgcomp == nil { + // create new one if needed + vgcomp = new(icons.LWarningCircle) + 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"} + vgparent.AppendChild(vgn) + { + vgcompKey := vugu.MakeCompKey(0x99CEB6B59A82F699^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LZoom) if vgcomp == nil { @@ -1121,7 +1137,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x1698690F1C0D96^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0x4F648DAD858C0E8A^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LZoomIn) if vgcomp == nil { @@ -1137,7 +1153,7 @@ func (c *ComponentIcons) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xE1A8373B4510AB44^vgin.CurrentPositionHash(), vgiterkey) + vgcompKey := vugu.MakeCompKey(0xD93ACD076218E08^vgin.CurrentPositionHash(), vgiterkey) // ask BuildEnv for prior instance of this specific component vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LZoomOut) if vgcomp == nil { diff --git a/components/overlay/container.go b/components/overlay/container.go index a2fcd2f..1832c48 100644 --- a/components/overlay/container.go +++ b/components/overlay/container.go @@ -1,6 +1,7 @@ package overlay import ( + "sync/atomic" "time" "git.d3nexus.de/Dadido3/D3vugu-components/components/navigation" @@ -16,6 +17,8 @@ type Container struct { modalContainerClasses string // Additional classes that are applied to the whole modal body. toasts []ContainerToast `vugu:"data"` + + waitOverlayCounter atomic.Int32 // Counter for the wait/loading overlay. If > 0, the overlay will be shown. } type ContainerToast struct { @@ -82,6 +85,25 @@ func (c *Container) CloseToast(component vugu.Builder) { } } +// WaitOverlayOpen returns true if the wait overlay is currently opened. +func (c *Container) WaitOverlayActive() bool { + return c.waitOverlayCounter.Load() != 0 +} + +// WaitOverlayOpen shows the wait overlay. +// Internally this is implemented as counter, so you have to ensure that there are as many WaitOverlayOpen as WaitOverlayDone calls. +// +// Always ensure that there is the complementary WaitOverlayDone() call, ideally with a defer. +func (c *Container) WaitOverlayOpen() { + c.waitOverlayCounter.Add(1) +} + +// WaitOverlayDone will mark the current wait overlay as done. +// Internally this is implemented as counter, so you have to ensure that there are as many WaitOverlayOpen as WaitOverlayDone calls. +func (c *Container) WaitOverlayDone() { + c.waitOverlayCounter.Add(-1) +} + type OverlayContainerRef struct { *Container } diff --git a/components/overlay/container.vugu b/components/overlay/container.vugu index 257ee80..8abbb21 100644 --- a/components/overlay/container.vugu +++ b/components/overlay/container.vugu @@ -17,6 +17,9 @@ +
+ +
diff --git a/icons/l-loading-circle_vgen.go b/icons/l-loading-circle_vgen.go new file mode 100644 index 0000000..af11f43 --- /dev/null +++ b/icons/l-loading-circle_vgen.go @@ -0,0 +1,51 @@ +package icons + +// 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" +) + +type LLoadingCircle struct { + AttrMap vugu.AttrMap +} + +func (c *LLoadingCircle) 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: "svg", Data: "svg", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "viewBox", Val: "0 0 16 16"}}} + vgout.Out = append(vgout.Out, vgn) // root for output + vgn.AddAttrList(utils.AttributesAppend{AttrMap: c.AttrMap, Classes: "d3c-icon d3-lineicon"}) + { + vgparent := vgn + _ = vgparent + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} + vgparent.AppendChild(vgn) + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "svg", Data: "circle", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1685282596-path d3c-icon-stroke"}, vugu.VGAttribute{Namespace: "", Key: "cx", Val: "8"}, vugu.VGAttribute{Namespace: "", Key: "cy", Val: "8"}, vugu.VGAttribute{Namespace: "", Key: "r", Val: "7.5"}, vugu.VGAttribute{Namespace: "", Key: "stroke-width", Val: "1"}, vugu.VGAttribute{Namespace: "", Key: "stroke-linejoin", Val: "round"}, vugu.VGAttribute{Namespace: "", Key: "stroke-linecap", Val: "round"}, vugu.VGAttribute{Namespace: "", Key: "fill", Val: "none"}}} + 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-icon {\n\t\theight: 1em;\n\t}\n\n\t.d3c-icon-stroke {\n\t\tstroke: var(--d3c-color-text);\n\t}\n\n\t.d3c-icon-fill {\n\t\tfill: var(--d3c-color-text);\n\t}\n\n\t.d3c-icon-use-color .d3c-icon-stroke {\n\t\tstroke: var(--d3c-color-background);\n\t}\n\n\t.d3c-icon-use-color .d3c-icon-fill {\n\t\tfill: var(--d3c-color-background);\n\t}\n\n\t/*Custom stuff for the animation.*/\n\n\t.d3c-1685282596-path {\n\t\tstroke-dasharray: 150, 200;\n\t\tstroke-dashoffset: -10;\n\t\tanimation: d3c-1685282596-rotate 2s linear infinite, d3c-1685282596-dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;\n\t\ttransform-origin: center;\n\t}\n\n\t@keyframes d3c-1685282596-rotate {\n\t\t100% {transform: rotate(360deg);}\n\t}\n\t@keyframes d3c-1685282596-dash {\n\t\t0% {stroke-dasharray: 1, 75; stroke-dashoffset: 0;}\n\t\t50% {stroke-dasharray: 33, 75; stroke-dashoffset: -13;}\n\t\t100% {stroke-dasharray: 33, 75; stroke-dashoffset: -46;}\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 diff --git a/icons/l-error-circle.vugu b/icons/l-warning-circle.vugu similarity index 96% rename from icons/l-error-circle.vugu rename to icons/l-warning-circle.vugu index 3e907c2..f539a42 100644 --- a/icons/l-error-circle.vugu +++ b/icons/l-warning-circle.vugu @@ -31,7 +31,7 @@ "git.d3nexus.de/Dadido3/D3vugu-components/utils" ) - type LErrorCircle struct{ + type LWarningCircle struct{ AttrMap vugu.AttrMap } diff --git a/icons/l-error-circle_vgen.go b/icons/l-warning-circle_vgen.go similarity index 97% rename from icons/l-error-circle_vgen.go rename to icons/l-warning-circle_vgen.go index a78cd89..f8bb18f 100644 --- a/icons/l-error-circle_vgen.go +++ b/icons/l-warning-circle_vgen.go @@ -12,11 +12,11 @@ import ( "git.d3nexus.de/Dadido3/D3vugu-components/utils" ) -type LErrorCircle struct { +type LWarningCircle struct { AttrMap vugu.AttrMap } -func (c *LErrorCircle) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { +func (c *LWarningCircle) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgout = &vugu.BuildOut{} diff --git a/page-overlays.go b/page-overlays.go index 39f657a..4c7a6da 100644 --- a/page-overlays.go +++ b/page-overlays.go @@ -47,3 +47,16 @@ func (c *PageOverlays) handleToastMessageButton(event vugu.DOMEvent) { func (c *PageOverlays) handleToastMessageTimeoutButton(event vugu.DOMEvent) { c.AddToast(event, &overlay.ToastMessage{MessageType: overlay.ToastMessageTypeSuccess, Message: "That worked!", Duration: 5 * time.Second}) } + +func (c *PageOverlays) handleWaitOverlayButton(event vugu.DOMEvent) { + c.WaitOverlayOpen() + go func() { + // Simulate some request or some other action. + time.Sleep(5 * time.Second) + // We need to lock and unlock the event environment in order for the DOM to re-render and the overlay to disappear correctly. + event.EventEnv().Lock() + defer event.EventEnv().UnlockRender() + defer c.WaitOverlayDone() // WaitOverlayDone has to be called before UnlockRender, so we need to put it afterwards (defer ordering). + // Update other UI stuff here. + }() +} diff --git a/page-overlays.vugu b/page-overlays.vugu index 8c4b697..8dccb6e 100644 --- a/page-overlays.vugu +++ b/page-overlays.vugu @@ -48,13 +48,33 @@ "}"' style="margin: 0;"> Open message toast -

To let the toast close itself after some time, you can use the duration field:

+

To let the toast close itself after some time, you can use the Duration option:


 		
Open self closing message toast + +

Wait/Load overlay

+

For actions that take a bit longer you can show the wait overlay:

+ +

+		
+ + Do some action that takes time + diff --git a/page-overlays_vgen.go b/page-overlays_vgen.go index eb70972..c9d3214 100644 --- a/page-overlays_vgen.go +++ b/page-overlays_vgen.go @@ -29,7 +29,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x39023F0CDBACD966^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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 "} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xB9DE577442910F7F^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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 "} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xBE6722F0749B5217^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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 "} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xCAD94AC17E6E5B74^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2E967CD9233EB11B^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xD16C8563CD69BC62^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -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"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xC09B140F2D9BB51D^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -281,7 +281,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xCDDB62C2B0EDDA4D^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -300,7 +300,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2AD22AAFDE078627^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -328,7 +328,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xAF384B6BFDDE9052^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -371,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 "} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x2E896CD80369149D^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -413,7 +413,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgparent := vgn _ = vgparent { - vgcompKey := vugu.MakeCompKey(0x65CF0DB4D3D649DD^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -446,7 +446,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgparent := vgn _ = vgparent { - vgcompKey := vugu.MakeCompKey(0x448A597BAE8DDE71^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -479,7 +479,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgparent := vgn _ = vgparent { - vgcompKey := vugu.MakeCompKey(0x9827A06ADED88FEF^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -512,7 +512,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgparent := vgn _ = vgparent { - vgcompKey := vugu.MakeCompKey(0xACC46AE85C7B6DA7^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -543,7 +543,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x1B1D06940120CF81^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -577,7 +577,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0x71D988D384981F90^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -612,7 +612,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { 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(0xF5B1D1CAC9C72095^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -628,7 +628,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgparent := vgn _ = vgparent - vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "duration"} + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "Duration"} vgparent.AppendChild(vgn) return }) @@ -636,13 +636,13 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Component: vgcomp} vgparent.AppendChild(vgn) } - vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: " field:"} + 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(0x77D7C4A8AA214DCF^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -676,7 +676,7 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) { - vgcompKey := vugu.MakeCompKey(0xD9ECCD7398AA380A^vgin.CurrentPositionHash(), vgiterkey) + 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 { @@ -701,6 +701,114 @@ func (c *PageOverlays) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { 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