D3vugu-components/components/input/field_vgen.go

74 lines
3.2 KiB
Go
Raw Permalink Normal View History

package input
// 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"
2023-06-04 15:45:27 +00:00
import (
//"git.d3nexus.de/Dadido3/D3vugu-components/icons"
"git.d3nexus.de/Dadido3/D3vugu-components/utils"
)
func (c *Field) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) {
vgout = &vugu.BuildOut{}
var vgiterkey interface{}
_ = vgiterkey
var vgn *vugu.VGNode
2023-06-04 15:45:27 +00:00
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)}
vgout.Out = append(vgout.Out, vgn) // root for output
2023-06-04 15:45:27 +00:00
vgn.AddAttrList(utils.AttributesAppend{AttrMap: c.AttrMap, Classes: "d3c-1684925699 d3c-button-borderless"})
{
vgparent := vgn
_ = vgparent
vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"}
vgparent.AppendChild(vgn)
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "input", Attr: []vugu.VGAttribute(nil)}
vgparent.AppendChild(vgn)
2023-06-04 15:45:27 +00:00
vgn.AddAttrInterface("id", c.ID)
vgn.AddAttrInterface("type", c.inputType())
vgn.AddAttrInterface("value", c.content())
vgn.DOMEventHandlerSpecList = append(vgn.DOMEventHandlerSpecList, vugu.DOMEventHandlerSpec{
EventType: "input",
Func: func(event vugu.DOMEvent) { c.handleChange(event) },
// TODO: implement capture, etc. mostly need to decide syntax
})
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\t"}
vgparent.AppendChild(vgn)
if c.err != nil {
vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1684925699-error d3c-color-critical"}}}
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-1684925699 {\n\t\tposition: relative;\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\t/*margin: 0.5em 0;*/\n\t\tpadding-left: 0.25em;\n\t\tborder-radius: 4px;\n\t\theight: 2em;\n\t\tborder: 1px solid var(--d3c-color-border);\n\t\tbackground-color: var(--d3c-color-background);\n\t\tcolor: var(--d3c-color-text);\n\t\t/*gap: 0.5em;*/\n\t}\n\n\t.d3c-1684925699-error {\n\t\tposition: absolute;\n\t\theight: 2px;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbackground-color: var(--d3c-color-background);\n\t}\n\n\t.d3c-1684925699 > input {\n\t\tborder: none !important;\n\t\toutline: none;\n\t\tflex-grow: 1;\n\t}\n\n\t.d3c-1684925699:has(> input:focus) {\n\t\toutline: 2px solid var(--d3c-color-accent);\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