Documentation ¶
Index ¶
- Constants
- Variables
- func Focus() engine.Attributer
- func FocusRemove(tag engine.Adder)
- func OnDiffApplyOnce(handler engine.EventHandler) *engine.ElementGroup
- func PageOptionCache(cache Cache) func(*Page)
- func PipelineProcessorRenderHashAndCache(logger zerolog.Logger, renderer *engine.Renderer, cache Cache) *engine.PipelineProcessor
- func PreemptDisableOn(eb *engine.EventBinding) *engine.ElementGroup
- func PreventDefaultRemove(tag engine.Adder)
- func Redirect(url string) engine.Attributer
- func ScrollTop(val int) engine.Attributer
- func ScrollTopRemove(tag engine.Adder)
- func StopPropagation() engine.Attributer
- func StopPropagationRemove(tag engine.Adder)
- type Cache
- type ComponentList
- type ComponentListSimple
- func (list *ComponentListSimple) Add(elements ...any)
- func (list *ComponentListSimple) AddItems(items ...engine.UniqueTagger)
- func (list *ComponentListSimple) GetComponent() engine.Componenter
- func (list *ComponentListSimple) GetNodes() *engine.NodeGroup
- func (list *ComponentListSimple) RemoveAllItems()
- func (list *ComponentListSimple) RemoveItems(items ...engine.UniqueTagger)
- type DOM
- func (dom DOM) Body(children ...engine.UberChild) *engine.UberElement
- func (dom DOM) DocType() engine.HTML
- func (dom DOM) HTML() *engine.UberElement
- func (dom DOM) Head(children ...engine.UberChild) *engine.UberElement
- func (dom DOM) Meta(children ...engine.UberChild) *engine.UberElement
- func (dom DOM) Title() *engine.UberElement
- type DiffApplyAttribute
- type FocusAttribute
- type Page
- type PreemptDisableAttribute
- type PreventDefaultAttribute
- type RedirectAttribute
- type ScrollTopAttribute
- type StopPropagationAttribute
Constants ¶
const ( PageHashAttr = "data-hlive-hash" PageHashAttrTmpl = "{data-hlive-hash}" )
const ( DiffApplyEvent = "diffapply" DiffApplyAttributeName = "data-hlive-on-diffapply" )
const FocusAttributeName = "data-hlive-focus"
const (
PreemptDisableAttributeName = "data-hlive-pre-disable"
)
const PreventDefaultAttributeName = "data-hlive-pd"
const RedirectAttributeName = "data-redirect"
const ScrollTopAttributeName = "data-scrollTop"
const StopPropagationAttributeName = "data-hlive-sp"
Variables ¶
var DiffApplyScript []byte
var ErrInvalidListAdd = errors.New("value is not valid for a list")
var FocusJavaScript []byte
var PreemptDisableOnClickJavaScript []byte
var PreventDefaultJavaScript []byte
var RedirectJavaScript []byte
var ScrollTopJavaScript []byte
var StopPropagationJavaScript []byte
Functions ¶
func Focus ¶
func Focus() engine.Attributer
func FocusRemove ¶
func OnDiffApplyOnce ¶
func OnDiffApplyOnce(handler engine.EventHandler) *engine.ElementGroup
TODO: how we remove the attribute once done?
func PageOptionCache ¶
func PipelineProcessorRenderHashAndCache ¶
func PipelineProcessorRenderHashAndCache(logger zerolog.Logger, renderer *engine.Renderer, cache Cache) *engine.PipelineProcessor
PipelineProcessorRenderHashAndCache that will cache the returned tree to support SSR
func PreemptDisableOn ¶
func PreemptDisableOn(eb *engine.EventBinding) *engine.ElementGroup
TODO: Once?
func PreventDefaultRemove ¶
func Redirect ¶
func Redirect(url string) engine.Attributer
func ScrollTop ¶
func ScrollTop(val int) engine.Attributer
func ScrollTopRemove ¶
func StopPropagation ¶
func StopPropagation() engine.Attributer
func StopPropagationRemove ¶
Types ¶
type ComponentList ¶
type ComponentList struct {
*ComponentListSimple
}
ComponentList is a way to manage a dynamic collection of Teardowner Node values. For example, the rows of a table.
As the Node values in ComponentList are often added and removed there lies the possibility of memory leaks. To prevent this the items in the list must be Teardowner values. The list will call Teardown on each item as long as they are removed using its RemoveItem and RemoveAllItems functions.
See NewComponentMountable, CM, WrapMountable, and WM for help with creating Teardowner values.
func List ¶
func List(name string, elements ...any) *ComponentList
List is a shortcut for NewComponentList.
func NewComponentList ¶
func NewComponentList(name string, elements ...any) *ComponentList
NewComponentList returns a value of ComponentList
func (*ComponentList) Add ¶
func (list *ComponentList) Add(elements ...any)
Add an element to this Component.
You can add Groups, Teardowner, EventBinding, or None Node Elements
func (*ComponentList) AddItem ¶
func (list *ComponentList) AddItem(items ...engine.Teardowner)
AddItem allows you to add a node to the list
Add nodes are often added and removed nodes needed to be a Teardowner. See NewComponentMountable, CM, WrapMountable, and WM for help with creating Teardowner values.
func (*ComponentList) RemoveAllItems ¶
func (list *ComponentList) RemoveAllItems()
RemoveAllItems empties the list of items and calls Teardown on each of them.
func (*ComponentList) RemoveItems ¶
func (list *ComponentList) RemoveItems(items ...engine.Teardowner)
RemoveItems will remove a Teardowner can call its Teardown function.
type ComponentListSimple ¶
type ComponentListSimple struct { *engine.ComponentMountable // contains filtered or unexported fields }
ComponentListSimple is a version of ComponentList that doesn't have the Teardown logic
func NewComponentListSimple ¶
func NewComponentListSimple(name string, elements ...any) *ComponentListSimple
NewComponentListSimple creates a ComponentListSimple value
func (*ComponentListSimple) Add ¶
func (list *ComponentListSimple) Add(elements ...any)
Add an element to this ComponentListSimple.
You can add Groups, UniqueTagger, EventBinding, or None Node Elements
func (*ComponentListSimple) AddItems ¶
func (list *ComponentListSimple) AddItems(items ...engine.UniqueTagger)
func (*ComponentListSimple) GetComponent ¶
func (list *ComponentListSimple) GetComponent() engine.Componenter
func (*ComponentListSimple) GetNodes ¶
func (list *ComponentListSimple) GetNodes() *engine.NodeGroup
GetNodes returns the list of items.
func (*ComponentListSimple) RemoveAllItems ¶
func (list *ComponentListSimple) RemoveAllItems()
func (*ComponentListSimple) RemoveItems ¶
func (list *ComponentListSimple) RemoveItems(items ...engine.UniqueTagger)
type DOM ¶
type DOM struct {
// contains filtered or unexported fields
}
func (DOM) HTML ¶
func (dom DOM) HTML() *engine.UberElement
func (DOM) Title ¶
func (dom DOM) Title() *engine.UberElement
type DiffApplyAttribute ¶
func OnDiffApply ¶
func OnDiffApply(handler engine.EventHandler) (*engine.EventBinding, *DiffApplyAttribute)
func (*DiffApplyAttribute) Initialize ¶
func (a *DiffApplyAttribute) Initialize(page engine.Pager)
func (*DiffApplyAttribute) InitializeSSR ¶
func (a *DiffApplyAttribute) InitializeSSR(page engine.Pager)
type FocusAttribute ¶
func (*FocusAttribute) Initialize ¶
func (a *FocusAttribute) Initialize(page engine.Pager)
func (*FocusAttribute) InitializeSSR ¶
func (a *FocusAttribute) InitializeSSR(page engine.Pager)
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
type PreemptDisableAttribute ¶
func (*PreemptDisableAttribute) Initialize ¶
func (a *PreemptDisableAttribute) Initialize(page engine.Pager)
func (*PreemptDisableAttribute) InitializeSSR ¶
func (a *PreemptDisableAttribute) InitializeSSR(pager engine.Pager)
type PreventDefaultAttribute ¶
func PreventDefault ¶
func PreventDefault() *PreventDefaultAttribute
func (*PreventDefaultAttribute) Initialize ¶
func (a *PreventDefaultAttribute) Initialize(page engine.Pager)
func (*PreventDefaultAttribute) InitializeSSR ¶
func (a *PreventDefaultAttribute) InitializeSSR(page engine.Pager)
type RedirectAttribute ¶
func (*RedirectAttribute) Initialize ¶
func (a *RedirectAttribute) Initialize(page engine.Pager)
func (*RedirectAttribute) InitializeSSR ¶
func (a *RedirectAttribute) InitializeSSR(page engine.Pager)
type ScrollTopAttribute ¶
func (*ScrollTopAttribute) Initialize ¶
func (a *ScrollTopAttribute) Initialize(page engine.Pager)
func (*ScrollTopAttribute) InitializeSSR ¶
func (a *ScrollTopAttribute) InitializeSSR(page engine.Pager)
type StopPropagationAttribute ¶
func (*StopPropagationAttribute) Initialize ¶
func (a *StopPropagationAttribute) Initialize(pager engine.Pager)
func (*StopPropagationAttribute) InitializeSSR ¶
func (a *StopPropagationAttribute) InitializeSSR(pager engine.Pager)