D3vugu-components/page-overlays.go
David Vogel 114a7d893c Add input field and a lot of other fixes
- Add input field and general data binding
- Rename SymbolSlot to IconSlot
- Remove d3c-color-accent
- Update icons page
- Add input example page
- Update button to support highlighting
- Update navigation entry to support highlighting
- Add d3c-button-only-icon to button and let sidebar use that
- Use d3c-button-transparent in sidebar
- Add focus indicator to buttons
- Rename CSS color variables and change definition of some
- Let pagination use input:Button
- Add some padding to the inline code component
2023-05-25 15:59:13 +02:00

42 lines
1.5 KiB
Go

package main
import (
"time"
"git.d3nexus.de/Dadido3/D3vugu-components/components/input"
"git.d3nexus.de/Dadido3/D3vugu-components/components/overlay"
"git.d3nexus.de/Dadido3/D3vugu-components/icons"
"github.com/vugu/vugu"
)
type PageOverlays struct {
overlay.OverlayContainerRef
}
func (c *PageOverlays) handleSimpleModalButton(event vugu.DOMEvent) {
c.SetModal(&overlay.ModalRequester{
IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{"style": "font-size: 2em;"}},
Title: "Simple requester",
Message: "This is a simple modal requester, are you happy with it?\nIt also supports multi line text!",
SignalColor: "d3c-color-attention",
ClickAbort: input.ClickFunc(func(event input.ClickEvent) {}),
ClickYes: input.ClickFunc(func(event input.ClickEvent) {}),
})
}
func (c *PageOverlays) handleSimpleToastButton(event vugu.DOMEvent) {
c.AddToast(&overlay.ToastSimple{
IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{"style": "font-size: 2em;"}},
Message: "This is a simple toast!\nIt supports multiple lines and has an icon slot.\nThere also can be multiple of it at the same time, this one was opened at " + time.Now().Format(time.TimeOnly) + ".",
SignalColor: "d3c-color-attention",
})
}
func (c *PageOverlays) handleWarningToastButton(event vugu.DOMEvent) {
c.AddToast(&overlay.ToastSimple{
IconSlot: &icons.LWarning{AttrMap: vugu.AttrMap{"style": "font-size: 2em;", "class": "d3c-color-caution d3c-icon-use-color"}},
Message: "This is a warning, be careful!",
SignalColor: "d3c-color-caution",
})
}