2023-05-18 21:17:17 +00:00
package main
import (
2023-05-19 21:45:39 +00:00
"time"
2023-05-18 21:17:17 +00:00
"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
}
2023-05-19 21:45:39 +00:00
func ( c * PageOverlays ) handleSimpleModalButton ( event vugu . DOMEvent ) {
2023-05-18 21:17:17 +00:00
c . SetModal ( & overlay . ModalRequester {
2023-05-25 13:59:13 +00:00
IconSlot : & icons . LInfoCircle { AttrMap : vugu . AttrMap { "style" : "font-size: 2em;" } } ,
2023-05-19 21:45:39 +00:00
Title : "Simple requester" ,
Message : "This is a simple modal requester, are you happy with it?\nIt also supports multi line text!" ,
2023-05-25 13:59:13 +00:00
SignalColor : "d3c-color-attention" ,
2023-05-19 21:45:39 +00:00
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 {
2023-05-25 13:59:13 +00:00
IconSlot : & icons . LInfoCircle { AttrMap : vugu . AttrMap { "style" : "font-size: 2em;" } } ,
2023-05-19 21:45:39 +00:00
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 ) + "." ,
2023-05-25 13:59:13 +00:00
SignalColor : "d3c-color-attention" ,
2023-05-19 21:45:39 +00:00
} )
}
func ( c * PageOverlays ) handleWarningToastButton ( event vugu . DOMEvent ) {
c . AddToast ( & overlay . ToastSimple {
2023-05-25 13:59:13 +00:00
IconSlot : & icons . LWarning { AttrMap : vugu . AttrMap { "style" : "font-size: 2em;" , "class" : "d3c-color-caution d3c-icon-use-color" } } ,
2023-05-19 21:45:39 +00:00
Message : "This is a warning, be careful!" ,
SignalColor : "d3c-color-caution" ,
2023-05-18 21:17:17 +00:00
} )
}