123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package web
- import (
- "context"
- h "github.com/theplant/htmlgo"
- )
- type PortalBuilder struct {
- tag *h.HTMLTagBuilder
- }
- func Portal(children ...h.HTMLComponent) (r *PortalBuilder) {
- r = &PortalBuilder{
- tag: h.Tag("go-plaid-portal").Children(children...),
- }
- r.Visible("true").Form("plaidForm")
- return
- }
- func (b *PortalBuilder) Loader(v *VueEventTagBuilder) (r *PortalBuilder) {
- b.tag.SetAttr(":loader", v.String())
- return b
- }
- func (b *PortalBuilder) Visible(v string) (r *PortalBuilder) {
- b.tag.Attr(":visible", v)
- return b
- }
- func (b *PortalBuilder) Name(v string) (r *PortalBuilder) {
- b.tag.Attr("portal-name", v)
- return b
- }
- func (b *PortalBuilder) Form(v string) (r *PortalBuilder) {
- b.tag.Attr(":portal-form", v)
- return b
- }
- func (b *PortalBuilder) AutoReloadInterval(v interface{}) (r *PortalBuilder) {
- b.tag.Attr(":auto-reload-interval", v)
- return b
- }
- func (b *PortalBuilder) Children(comps ...h.HTMLComponent) (r *PortalBuilder) {
- b.tag.Children(comps...)
- return b
- }
- func (b *PortalBuilder) LoadWhenParentVisible() (r *PortalBuilder) {
- b.Visible("parent.isVisible")
- return b
- }
- func (b *PortalBuilder) ParentForceUpdateAfterLoaded() (r *PortalBuilder) {
- b.tag.Attr(":after-loaded", "parent.forceUpdate")
- return b
- }
- func (b *PortalBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
- return b.tag.MarshalHTML(ctx)
- }
|