David Vogel
114a7d893c
- 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
49 lines
2.5 KiB
Plaintext
49 lines
2.5 KiB
Plaintext
<div>
|
|
<layout:Container>
|
|
<h1>Overlays</h1>
|
|
<p>Overlays are handled by the <view:CodeInline>overlay.Container</view:CodeInline> component which has to be embedded into your root component.</p>
|
|
<p>Every page or component that creates overlays has to embed the <view:CodeInline>overlay.OverlayContainerRef</view:CodeInline> structure. Your wiring function also needs to set the reference to your <view:CodeInline>overlay.Container</view:CodeInline> that you have placed in your root component.</p>
|
|
|
|
<h2>Modals</h2>
|
|
<p>A simple requester modal is already contained in the overlay package. Use it with:</p>
|
|
<view:Code>
|
|
<pre vg-content='"func (c *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.SetModal(&overlay.ModalRequester{\n" +
|
|
" IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{\"style\": \"font-size: 2em;\"}},\n" +
|
|
" Title: \"Simple requester\",\n" +
|
|
" Message: \"This is a simple modal requester, are you happy with it?\\nIt also supports multi line text!\",\n" +
|
|
" SignalColor: \"d3c-color-accent\",\n" +
|
|
" ClickAbort: input.ClickFunc(func(event input.ClickEvent) {}),\n" +
|
|
" ClickYes: input.ClickFunc(func(event input.ClickEvent) {}),\n" +
|
|
" })\n" +
|
|
"}"' style="margin: 0;"></pre>
|
|
</view:Code>
|
|
<input:Button @Click="c.handleSimpleModalButton(event)">Open simple modal</input:Button>
|
|
|
|
<h2>Toasts</h2>
|
|
<p>A simple text and icon containing toast is already contained in the overlay package. Use it with:</p>
|
|
<view:Code>
|
|
<pre vg-content='"func (c *PageOverlays) handleButton(event vugu.DOMEvent) {\n" +
|
|
" c.AddToast(&overlay.ToastSimple{\n" +
|
|
" IconSlot: &icons.LInfoCircle{AttrMap: vugu.AttrMap{\"style\": \"font-size: 2em;\"}},\n" +
|
|
" 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) + \".\",\n" +
|
|
" SignalColor: \"d3c-color-accent\",\n" +
|
|
" })\n" +
|
|
"}"' style="margin: 0;"></pre>
|
|
</view:Code>
|
|
<input:Button @Click="c.handleSimpleToastButton(event)">Open simple toast</input:Button>
|
|
<input:Button @Click="c.handleWarningToastButton(event)">Open warning toast</input:Button>
|
|
</layout:Container>
|
|
</div>
|
|
|
|
<style>
|
|
</style>
|
|
|
|
<script type="application/x-go">
|
|
import (
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/input"
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/layout"
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/view"
|
|
)
|
|
</script>
|