Documentation
¶
Overview ¶
Package element provides containers, text, form controls, and overlays for building a Kite document. Constructors such as Box and Span accept child nodes and convert strings to text nodes. Mount the resulting tree on the engine.
ui := element.Box(element.Span("Hello"), element.Button("Continue"))
Index ¶
- Constants
- Variables
- type BoxElement
- func (b *BoxElement) AddChild(child dom.Node) *Self
- func (b *BoxElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *BoxElement) CursorNavigable(v bool) *Self
- func (b *BoxElement) DefaultStyle() style.Style
- func (b *BoxElement) DispatchEvent(e event.Event)
- func (b *BoxElement) EventListeners() []PendingListener
- func (b *BoxElement) Hidden(v bool) *Self
- func (b *BoxElement) IntrinsicStyle() style.Style
- func (b *BoxElement) IsCursorNavigable() bool
- func (b *BoxElement) IsDirtyStyle() bool
- func (b *BoxElement) IsHidden() bool
- func (b *BoxElement) Listeners() []PendingListener
- func (b *BoxElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *BoxElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *BoxElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnConnect(fn func()) *Self
- func (b *BoxElement) OnConnected()
- func (b *BoxElement) OnDisconnect(fn func()) *Self
- func (b *BoxElement) OnDisconnected()
- func (b *BoxElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *BoxElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *BoxElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *BoxElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *BoxElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *BoxElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *BoxElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *BoxElement) OnPress(fn func()) *Self
- func (b *BoxElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *BoxElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *BoxElement) RawStyle() style.Style
- func (b *BoxElement) Ref(dst **Self) *Self
- func (b *BoxElement) ResetCaret(dir dom.Direction)
- func (b *BoxElement) ScrollbarX(v bool) *Self
- func (b *BoxElement) ScrollbarY(v bool) *Self
- func (b *BoxElement) SetCursorNavigable(v bool)
- func (b *BoxElement) SetHidden(v bool)
- func (b *BoxElement) SetStyle(s style.Style)
- func (b *BoxElement) SetText(text string) *Self
- func (b *BoxElement) SetTextf(format string, args ...any) *Self
- func (b *BoxElement) Style(s style.Style) *Self
- func (b *BoxElement) Unwrap() dom.Node
- func (b *BoxElement) WithClass(class string) *Self
- func (b *BoxElement) WithID(id string) *Self
- func (b *BoxElement) WithTabIndex(index int) *Self
- type BrElement
- func (b *BrElement) AddChild(child dom.Node) *Self
- func (b *BrElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *BrElement) CursorNavigable(v bool) *Self
- func (b *BrElement) DefaultStyle() style.Style
- func (b *BrElement) DispatchEvent(e event.Event)
- func (b *BrElement) EventListeners() []PendingListener
- func (b *BrElement) Hidden(v bool) *Self
- func (b *BrElement) IntrinsicStyle() style.Style
- func (b *BrElement) IsBr() bool
- func (b *BrElement) IsCursorNavigable() bool
- func (b *BrElement) IsDirtyStyle() bool
- func (b *BrElement) IsFocusable() bool
- func (b *BrElement) IsHidden() bool
- func (b *BrElement) IsPlaceholderBr() bool
- func (b *BrElement) Listeners() []PendingListener
- func (b *BrElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *BrElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *BrElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnConnect(fn func()) *Self
- func (b *BrElement) OnConnected()
- func (b *BrElement) OnDisconnect(fn func()) *Self
- func (b *BrElement) OnDisconnected()
- func (b *BrElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *BrElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *BrElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *BrElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *BrElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *BrElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *BrElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *BrElement) OnPress(fn func()) *Self
- func (b *BrElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *BrElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *BrElement) RawStyle() style.Style
- func (b *BrElement) Ref(dst **Self) *Self
- func (b *BrElement) ResetCaret(dir dom.Direction)
- func (b *BrElement) ScrollbarX(v bool) *Self
- func (b *BrElement) ScrollbarY(v bool) *Self
- func (b *BrElement) SetCursorNavigable(v bool)
- func (b *BrElement) SetHidden(v bool)
- func (b *BrElement) SetStyle(s style.Style)
- func (b *BrElement) SetText(text string) *Self
- func (b *BrElement) SetTextf(format string, args ...any) *Self
- func (b *BrElement) Style(s style.Style) *Self
- func (b *BrElement) Unwrap() dom.Node
- func (b *BrElement) WithClass(class string) *Self
- func (b *BrElement) WithID(id string) *Self
- func (b *BrElement) WithTabIndex(index int) *Self
- type ButtonElement
- func (b *ButtonElement) AddChild(child dom.Node) *Self
- func (b *ButtonElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *ButtonElement) ButtonType() string
- func (b *ButtonElement) CursorNavigable(v bool) *Self
- func (b *ButtonElement) DefaultStyle() style.Style
- func (b *ButtonElement) Disabled(v bool) *ButtonElement
- func (b *ButtonElement) DispatchEvent(e event.Event)
- func (b *ButtonElement) EventListeners() []PendingListener
- func (b *ButtonElement) Hidden(v bool) *Self
- func (b *ButtonElement) IntrinsicStyle() style.Style
- func (b *ButtonElement) IsCursorNavigable() bool
- func (b *ButtonElement) IsDirtyStyle() bool
- func (b *ButtonElement) IsDisabled() bool
- func (b *ButtonElement) IsHidden() bool
- func (b *ButtonElement) Listeners() []PendingListener
- func (b *ButtonElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *ButtonElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *ButtonElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnConnect(fn func()) *Self
- func (b *ButtonElement) OnConnected()
- func (b *ButtonElement) OnDisconnect(fn func()) *Self
- func (b *ButtonElement) OnDisconnected()
- func (b *ButtonElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *ButtonElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *ButtonElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *ButtonElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *ButtonElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *ButtonElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *ButtonElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *ButtonElement) OnPress(fn func()) *Self
- func (b *ButtonElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *ButtonElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *ButtonElement) RawStyle() style.Style
- func (b *ButtonElement) Ref(dst **Self) *Self
- func (b *ButtonElement) ResetCaret(dir dom.Direction)
- func (b *ButtonElement) ScrollbarX(v bool) *Self
- func (b *ButtonElement) ScrollbarY(v bool) *Self
- func (b *ButtonElement) SetActive(active bool)
- func (b *ButtonElement) SetCursorNavigable(v bool)
- func (b *ButtonElement) SetData(data string)
- func (b *ButtonElement) SetDisabled(v bool)
- func (b *ButtonElement) SetHidden(v bool)
- func (b *ButtonElement) SetStyle(s style.Style)
- func (b *ButtonElement) SetText(text string) *Self
- func (b *ButtonElement) SetTextf(format string, args ...any) *Self
- func (b *ButtonElement) Style(s style.Style) *Self
- func (b *ButtonElement) Type(btnType string) *ButtonElement
- func (b *ButtonElement) Unwrap() dom.Node
- func (b *ButtonElement) WithClass(class string) *Self
- func (b *ButtonElement) WithID(id string) *Self
- func (b *ButtonElement) WithTabIndex(index int) *Self
- type CaretController
- type CheckboxElement
- func (b *CheckboxElement) AddChild(child dom.Node) *Self
- func (b *CheckboxElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (c *CheckboxElement) Checked() bool
- func (b *CheckboxElement) CursorNavigable(v bool) *Self
- func (b *CheckboxElement) DefaultStyle() style.Style
- func (c *CheckboxElement) Disabled(v bool) *CheckboxElement
- func (b *CheckboxElement) DispatchEvent(e event.Event)
- func (b *CheckboxElement) EventListeners() []PendingListener
- func (b *CheckboxElement) Hidden(v bool) *Self
- func (b *CheckboxElement) IntrinsicStyle() style.Style
- func (b *CheckboxElement) IsCursorNavigable() bool
- func (b *CheckboxElement) IsDirtyStyle() bool
- func (c *CheckboxElement) IsDisabled() bool
- func (b *CheckboxElement) IsHidden() bool
- func (b *CheckboxElement) Listeners() []PendingListener
- func (b *CheckboxElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (c *CheckboxElement) Name() string
- func (b *CheckboxElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (c *CheckboxElement) OnChange(fn func(bool)) *CheckboxElement
- func (b *CheckboxElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnConnect(fn func()) *Self
- func (b *CheckboxElement) OnConnected()
- func (b *CheckboxElement) OnDisconnect(fn func()) *Self
- func (b *CheckboxElement) OnDisconnected()
- func (b *CheckboxElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *CheckboxElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *CheckboxElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *CheckboxElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *CheckboxElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *CheckboxElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *CheckboxElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *CheckboxElement) OnPress(fn func()) *Self
- func (b *CheckboxElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *CheckboxElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *CheckboxElement) RawStyle() style.Style
- func (b *CheckboxElement) Ref(dst **Self) *Self
- func (b *CheckboxElement) ResetCaret(dir dom.Direction)
- func (b *CheckboxElement) ScrollbarX(v bool) *Self
- func (b *CheckboxElement) ScrollbarY(v bool) *Self
- func (c *CheckboxElement) SetChecked(checked bool) *CheckboxElement
- func (b *CheckboxElement) SetCursorNavigable(v bool)
- func (c *CheckboxElement) SetDisabled(v bool)
- func (c *CheckboxElement) SetGlyphs(unchecked, checked string) *CheckboxElement
- func (b *CheckboxElement) SetHidden(v bool)
- func (b *CheckboxElement) SetStyle(s style.Style)
- func (b *CheckboxElement) SetText(text string) *Self
- func (b *CheckboxElement) SetTextf(format string, args ...any) *Self
- func (b *CheckboxElement) Style(s style.Style) *Self
- func (b *CheckboxElement) Unwrap() dom.Node
- func (c *CheckboxElement) Value() any
- func (b *CheckboxElement) WithClass(class string) *Self
- func (b *CheckboxElement) WithID(id string) *Self
- func (c *CheckboxElement) WithName(name string) *CheckboxElement
- func (b *CheckboxElement) WithTabIndex(index int) *Self
- type DialogElement
- func (b *DialogElement) AddChild(child dom.Node) *Self
- func (b *DialogElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *DialogElement) CursorNavigable(v bool) *Self
- func (b *DialogElement) DefaultStyle() style.Style
- func (b *DialogElement) DispatchEvent(e event.Event)
- func (b *DialogElement) EventListeners() []PendingListener
- func (b *DialogElement) Hidden(v bool) *Self
- func (b *DialogElement) IntrinsicStyle() style.Style
- func (b *DialogElement) IsCursorNavigable() bool
- func (b *DialogElement) IsDirtyStyle() bool
- func (d *DialogElement) IsFocusable() bool
- func (b *DialogElement) IsHidden() bool
- func (b *DialogElement) Listeners() []PendingListener
- func (b *DialogElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *DialogElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *DialogElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnConnect(fn func()) *Self
- func (d *DialogElement) OnConnected()
- func (b *DialogElement) OnDisconnect(fn func()) *Self
- func (d *DialogElement) OnDisconnected()
- func (b *DialogElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *DialogElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *DialogElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *DialogElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *DialogElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *DialogElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *DialogElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *DialogElement) OnPress(fn func()) *Self
- func (b *DialogElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (d *DialogElement) OnWheel(e *event.WheelEvent)
- func (b *DialogElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *DialogElement) RawStyle() style.Style
- func (b *DialogElement) Ref(dst **Self) *Self
- func (b *DialogElement) ResetCaret(dir dom.Direction)
- func (b *DialogElement) ScrollbarX(v bool) *Self
- func (b *DialogElement) ScrollbarY(v bool) *Self
- func (b *DialogElement) SetCursorNavigable(v bool)
- func (b *DialogElement) SetHidden(v bool)
- func (b *DialogElement) SetStyle(s style.Style)
- func (b *DialogElement) SetText(text string) *Self
- func (b *DialogElement) SetTextf(format string, args ...any) *Self
- func (d *DialogElement) SetZIndex(zIndex int) *DialogElement
- func (b *DialogElement) Style(s style.Style) *Self
- func (b *DialogElement) Unwrap() dom.Node
- func (b *DialogElement) WithClass(class string) *Self
- func (b *DialogElement) WithID(id string) *Self
- func (b *DialogElement) WithTabIndex(index int) *Self
- func (d *DialogElement) ZIndex(zIndex int) *DialogElement
- type Element
- type FormElement
- func (b *FormElement) AddChild(child dom.Node) *Self
- func (b *FormElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *FormElement) CursorNavigable(v bool) *Self
- func (b *FormElement) DefaultStyle() style.Style
- func (b *FormElement) DispatchEvent(e event.Event)
- func (b *FormElement) EventListeners() []PendingListener
- func (b *FormElement) Hidden(v bool) *Self
- func (b *FormElement) IntrinsicStyle() style.Style
- func (b *FormElement) IsCursorNavigable() bool
- func (b *FormElement) IsDirtyStyle() bool
- func (b *FormElement) IsHidden() bool
- func (b *FormElement) Listeners() []PendingListener
- func (b *FormElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *FormElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *FormElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnConnect(fn func()) *Self
- func (b *FormElement) OnConnected()
- func (b *FormElement) OnDisconnect(fn func()) *Self
- func (b *FormElement) OnDisconnected()
- func (b *FormElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *FormElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *FormElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *FormElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *FormElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *FormElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *FormElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *FormElement) OnPress(fn func()) *Self
- func (b *FormElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *FormElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *FormElement) RawStyle() style.Style
- func (b *FormElement) Ref(dst **Self) *Self
- func (f *FormElement) Reset()
- func (b *FormElement) ResetCaret(dir dom.Direction)
- func (b *FormElement) ScrollbarX(v bool) *Self
- func (b *FormElement) ScrollbarY(v bool) *Self
- func (b *FormElement) SetCursorNavigable(v bool)
- func (b *FormElement) SetHidden(v bool)
- func (b *FormElement) SetStyle(s style.Style)
- func (b *FormElement) SetText(text string) *Self
- func (b *FormElement) SetTextf(format string, args ...any) *Self
- func (f *FormElement) SetValues(values map[string]any)
- func (b *FormElement) Style(s style.Style) *Self
- func (f *FormElement) Submit()
- func (b *FormElement) Unwrap() dom.Node
- func (f *FormElement) Values() map[string]any
- func (b *FormElement) WithClass(class string) *Self
- func (b *FormElement) WithID(id string) *Self
- func (b *FormElement) WithTabIndex(index int) *Self
- type FormResetEvent
- type InputElement
- func (b *InputElement) AddChild(child dom.Node) *Self
- func (b *InputElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (inp *InputElement) Blur()
- func (inp *InputElement) Buffer() *text.Buffer
- func (b *InputElement) CursorNavigable(v bool) *Self
- func (b *InputElement) DefaultStyle() style.Style
- func (inp *InputElement) Disabled(v bool) *InputElement
- func (b *InputElement) DispatchEvent(e event.Event)
- func (b *InputElement) EventListeners() []PendingListener
- func (inp *InputElement) Focus()
- func (b *InputElement) Hidden(v bool) *Self
- func (b *InputElement) IntrinsicStyle() style.Style
- func (b *InputElement) IsCursorNavigable() bool
- func (b *InputElement) IsDirtyStyle() bool
- func (inp *InputElement) IsDisabled() bool
- func (inp *InputElement) IsFocusable() bool
- func (b *InputElement) IsHidden() bool
- func (b *InputElement) Listeners() []PendingListener
- func (inp *InputElement) Mask() rune
- func (b *InputElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (inp *InputElement) Name() string
- func (b *InputElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (inp *InputElement) OnChange(fn func(string)) *InputElement
- func (b *InputElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnConnect(fn func()) *Self
- func (b *InputElement) OnConnected()
- func (b *InputElement) OnDisconnect(fn func()) *Self
- func (b *InputElement) OnDisconnected()
- func (b *InputElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *InputElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *InputElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *InputElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *InputElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *InputElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *InputElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *InputElement) OnPress(fn func()) *Self
- func (b *InputElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (inp *InputElement) OnWheel(e *event.WheelEvent)
- func (b *InputElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (inp *InputElement) Password() bool
- func (b *InputElement) RawStyle() style.Style
- func (b *InputElement) Ref(dst **Self) *Self
- func (b *InputElement) ResetCaret(dir dom.Direction)
- func (b *InputElement) ScrollbarX(v bool) *Self
- func (b *InputElement) ScrollbarY(v bool) *Self
- func (b *InputElement) SetCursorNavigable(v bool)
- func (inp *InputElement) SetDisabled(v bool)
- func (b *InputElement) SetHidden(v bool)
- func (b *InputElement) SetStyle(s style.Style)
- func (b *InputElement) SetText(text string) *Self
- func (b *InputElement) SetTextf(format string, args ...any) *Self
- func (inp *InputElement) SetValue(v string) *InputElement
- func (b *InputElement) Style(s style.Style) *Self
- func (inp *InputElement) SyncBuffer()
- func (inp *InputElement) Text() string
- func (inp *InputElement) TextContent() string
- func (b *InputElement) Unwrap() dom.Node
- func (inp *InputElement) Value() any
- func (b *InputElement) WithClass(class string) *Self
- func (b *InputElement) WithID(id string) *Self
- func (inp *InputElement) WithMask(r rune) *InputElement
- func (inp *InputElement) WithName(name string) *InputElement
- func (inp *InputElement) WithPassword(enabled bool) *InputElement
- func (inp *InputElement) WithPlaceholder(p string) *InputElement
- func (inp *InputElement) WithPlaceholderStyle(s style.Style) *InputElement
- func (b *InputElement) WithTabIndex(index int) *Self
- type LabelElement
- func (b *LabelElement) AddChild(child dom.Node) *Self
- func (b *LabelElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (l *LabelElement) Control() Element
- func (b *LabelElement) CursorNavigable(v bool) *Self
- func (b *LabelElement) DefaultStyle() style.Style
- func (b *LabelElement) DispatchEvent(e event.Event)
- func (b *LabelElement) EventListeners() []PendingListener
- func (l *LabelElement) For(id string) *LabelElement
- func (l *LabelElement) ForID() string
- func (b *LabelElement) Hidden(v bool) *Self
- func (b *LabelElement) IntrinsicStyle() style.Style
- func (b *LabelElement) IsCursorNavigable() bool
- func (b *LabelElement) IsDirtyStyle() bool
- func (b *LabelElement) IsHidden() bool
- func (b *LabelElement) Listeners() []PendingListener
- func (b *LabelElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *LabelElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *LabelElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnConnect(fn func()) *Self
- func (b *LabelElement) OnConnected()
- func (b *LabelElement) OnDisconnect(fn func()) *Self
- func (b *LabelElement) OnDisconnected()
- func (b *LabelElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *LabelElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *LabelElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *LabelElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *LabelElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *LabelElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *LabelElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *LabelElement) OnPress(fn func()) *Self
- func (b *LabelElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *LabelElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *LabelElement) RawStyle() style.Style
- func (b *LabelElement) Ref(dst **Self) *Self
- func (b *LabelElement) ResetCaret(dir dom.Direction)
- func (b *LabelElement) ScrollbarX(v bool) *Self
- func (b *LabelElement) ScrollbarY(v bool) *Self
- func (b *LabelElement) SetCursorNavigable(v bool)
- func (l *LabelElement) SetFor(id string)
- func (b *LabelElement) SetHidden(v bool)
- func (b *LabelElement) SetStyle(s style.Style)
- func (b *LabelElement) SetText(text string) *Self
- func (b *LabelElement) SetTextf(format string, args ...any) *Self
- func (b *LabelElement) Style(s style.Style) *Self
- func (b *LabelElement) Unwrap() dom.Node
- func (b *LabelElement) WithClass(class string) *Self
- func (b *LabelElement) WithID(id string) *Self
- func (b *LabelElement) WithTabIndex(index int) *Self
- type ListItemElement
- func (b *ListItemElement) AddChild(child dom.Node) *Self
- func (b *ListItemElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *ListItemElement) CursorNavigable(v bool) *Self
- func (b *ListItemElement) DefaultStyle() style.Style
- func (b *ListItemElement) DispatchEvent(e event.Event)
- func (b *ListItemElement) EventListeners() []PendingListener
- func (b *ListItemElement) Hidden(v bool) *Self
- func (b *ListItemElement) IntrinsicStyle() style.Style
- func (b *ListItemElement) IsCursorNavigable() bool
- func (b *ListItemElement) IsDirtyStyle() bool
- func (b *ListItemElement) IsHidden() bool
- func (b *ListItemElement) Listeners() []PendingListener
- func (b *ListItemElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *ListItemElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *ListItemElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnConnect(fn func()) *Self
- func (b *ListItemElement) OnConnected()
- func (b *ListItemElement) OnDisconnect(fn func()) *Self
- func (b *ListItemElement) OnDisconnected()
- func (b *ListItemElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *ListItemElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *ListItemElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *ListItemElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *ListItemElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *ListItemElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *ListItemElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *ListItemElement) OnPress(fn func()) *Self
- func (b *ListItemElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *ListItemElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *ListItemElement) RawStyle() style.Style
- func (b *ListItemElement) Ref(dst **Self) *Self
- func (b *ListItemElement) ResetCaret(dir dom.Direction)
- func (b *ListItemElement) ScrollbarX(v bool) *Self
- func (b *ListItemElement) ScrollbarY(v bool) *Self
- func (b *ListItemElement) SetCursorNavigable(v bool)
- func (b *ListItemElement) SetHidden(v bool)
- func (b *ListItemElement) SetStyle(s style.Style)
- func (b *ListItemElement) SetText(text string) *Self
- func (b *ListItemElement) SetTextf(format string, args ...any) *Self
- func (b *ListItemElement) Style(s style.Style) *Self
- func (b *ListItemElement) Unwrap() dom.Node
- func (b *ListItemElement) WithClass(class string) *Self
- func (b *ListItemElement) WithID(id string) *Self
- func (b *ListItemElement) WithTabIndex(index int) *Self
- type OptionElement
- func (b *OptionElement) AddChild(child dom.Node) *Self
- func (b *OptionElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *OptionElement) CursorNavigable(v bool) *Self
- func (b *OptionElement) DefaultStyle() style.Style
- func (o *OptionElement) Disabled(v bool) *OptionElement
- func (b *OptionElement) DispatchEvent(e event.Event)
- func (b *OptionElement) EventListeners() []PendingListener
- func (b *OptionElement) Hidden(v bool) *Self
- func (o *OptionElement) IntrinsicStyle() style.Style
- func (b *OptionElement) IsCursorNavigable() bool
- func (b *OptionElement) IsDirtyStyle() bool
- func (o *OptionElement) IsDisabled() bool
- func (b *OptionElement) IsHidden() bool
- func (b *OptionElement) Listeners() []PendingListener
- func (b *OptionElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *OptionElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *OptionElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnConnect(fn func()) *Self
- func (b *OptionElement) OnConnected()
- func (b *OptionElement) OnDisconnect(fn func()) *Self
- func (b *OptionElement) OnDisconnected()
- func (b *OptionElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *OptionElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *OptionElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *OptionElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *OptionElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *OptionElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *OptionElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *OptionElement) OnPress(fn func()) *Self
- func (b *OptionElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *OptionElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *OptionElement) RawStyle() style.Style
- func (b *OptionElement) Ref(dst **Self) *Self
- func (b *OptionElement) ResetCaret(dir dom.Direction)
- func (b *OptionElement) ScrollbarX(v bool) *Self
- func (b *OptionElement) ScrollbarY(v bool) *Self
- func (b *OptionElement) SetCursorNavigable(v bool)
- func (o *OptionElement) SetDisabled(v bool)
- func (b *OptionElement) SetHidden(v bool)
- func (b *OptionElement) SetStyle(s style.Style)
- func (o *OptionElement) SetText(text string) *OptionElement
- func (b *OptionElement) SetTextf(format string, args ...any) *Self
- func (o *OptionElement) SetValue(value string) *OptionElement
- func (b *OptionElement) Style(s style.Style) *Self
- func (b *OptionElement) Unwrap() dom.Node
- func (b *OptionElement) WithClass(class string) *Self
- func (b *OptionElement) WithID(id string) *Self
- func (b *OptionElement) WithTabIndex(index int) *Self
- type OrderedListElement
- func (b *OrderedListElement) AddChild(child dom.Node) *Self
- func (b *OrderedListElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *OrderedListElement) CursorNavigable(v bool) *Self
- func (b *OrderedListElement) DefaultStyle() style.Style
- func (b *OrderedListElement) DispatchEvent(e event.Event)
- func (b *OrderedListElement) EventListeners() []PendingListener
- func (b *OrderedListElement) Hidden(v bool) *Self
- func (b *OrderedListElement) IntrinsicStyle() style.Style
- func (b *OrderedListElement) IsCursorNavigable() bool
- func (b *OrderedListElement) IsDirtyStyle() bool
- func (b *OrderedListElement) IsHidden() bool
- func (b *OrderedListElement) Listeners() []PendingListener
- func (b *OrderedListElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *OrderedListElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *OrderedListElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnConnect(fn func()) *Self
- func (b *OrderedListElement) OnConnected()
- func (b *OrderedListElement) OnDisconnect(fn func()) *Self
- func (b *OrderedListElement) OnDisconnected()
- func (b *OrderedListElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *OrderedListElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *OrderedListElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *OrderedListElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *OrderedListElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *OrderedListElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *OrderedListElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *OrderedListElement) OnPress(fn func()) *Self
- func (b *OrderedListElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *OrderedListElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *OrderedListElement) RawStyle() style.Style
- func (b *OrderedListElement) Ref(dst **Self) *Self
- func (b *OrderedListElement) ResetCaret(dir dom.Direction)
- func (b *OrderedListElement) ScrollbarX(v bool) *Self
- func (b *OrderedListElement) ScrollbarY(v bool) *Self
- func (b *OrderedListElement) SetCursorNavigable(v bool)
- func (b *OrderedListElement) SetHidden(v bool)
- func (b *OrderedListElement) SetStyle(s style.Style)
- func (b *OrderedListElement) SetText(text string) *Self
- func (b *OrderedListElement) SetTextf(format string, args ...any) *Self
- func (b *OrderedListElement) Style(s style.Style) *Self
- func (b *OrderedListElement) Unwrap() dom.Node
- func (b *OrderedListElement) WithClass(class string) *Self
- func (b *OrderedListElement) WithID(id string) *Self
- func (b *OrderedListElement) WithTabIndex(index int) *Self
- type OverlayConfig
- type OverlayElement
- func (b *OverlayElement) AddChild(child dom.Node) *Self
- func (o *OverlayElement) Anchor() dom.Node
- func (b *OverlayElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (o *OverlayElement) CreateRenderObject() render.Object
- func (b *OverlayElement) CursorNavigable(v bool) *Self
- func (b *OverlayElement) DefaultStyle() style.Style
- func (b *OverlayElement) DispatchEvent(e event.Event)
- func (b *OverlayElement) EventListeners() []PendingListener
- func (o *OverlayElement) Flip() bool
- func (b *OverlayElement) Hidden(v bool) *Self
- func (b *OverlayElement) IntrinsicStyle() style.Style
- func (b *OverlayElement) IsCursorNavigable() bool
- func (b *OverlayElement) IsDirtyStyle() bool
- func (b *OverlayElement) IsHidden() bool
- func (b *OverlayElement) Listeners() []PendingListener
- func (b *OverlayElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *OverlayElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *OverlayElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnConnect(fn func()) *Self
- func (o *OverlayElement) OnConnected()
- func (b *OverlayElement) OnDisconnect(fn func()) *Self
- func (o *OverlayElement) OnDisconnected()
- func (b *OverlayElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *OverlayElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *OverlayElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *OverlayElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *OverlayElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *OverlayElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *OverlayElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *OverlayElement) OnPress(fn func()) *Self
- func (b *OverlayElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *OverlayElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (o *OverlayElement) Placement() geom.Placement
- func (b *OverlayElement) RawStyle() style.Style
- func (b *OverlayElement) Ref(dst **Self) *Self
- func (b *OverlayElement) ResetCaret(dir dom.Direction)
- func (b *OverlayElement) ScrollbarX(v bool) *Self
- func (b *OverlayElement) ScrollbarY(v bool) *Self
- func (o *OverlayElement) SetConfig(config OverlayConfig) *OverlayElement
- func (b *OverlayElement) SetCursorNavigable(v bool)
- func (b *OverlayElement) SetHidden(v bool)
- func (b *OverlayElement) SetStyle(s style.Style)
- func (b *OverlayElement) SetText(text string) *Self
- func (b *OverlayElement) SetTextf(format string, args ...any) *Self
- func (b *OverlayElement) Style(s style.Style) *Self
- func (b *OverlayElement) Unwrap() dom.Node
- func (o *OverlayElement) WithAnchor(a dom.Element) *OverlayElement
- func (b *OverlayElement) WithClass(class string) *Self
- func (o *OverlayElement) WithFlip(flip bool) *OverlayElement
- func (b *OverlayElement) WithID(id string) *Self
- func (o *OverlayElement) WithPlacement(p geom.Placement) *OverlayElement
- func (b *OverlayElement) WithTabIndex(index int) *Self
- func (o *OverlayElement) WithZIndex(zIndex int) *OverlayElement
- type PendingListener
- type RadioElement
- func (b *RadioElement) AddChild(child dom.Node) *Self
- func (b *RadioElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (r *RadioElement) Checked() bool
- func (b *RadioElement) CursorNavigable(v bool) *Self
- func (b *RadioElement) DefaultStyle() style.Style
- func (r *RadioElement) Disabled(v bool) *RadioElement
- func (b *RadioElement) DispatchEvent(e event.Event)
- func (b *RadioElement) EventListeners() []PendingListener
- func (b *RadioElement) Hidden(v bool) *Self
- func (b *RadioElement) IntrinsicStyle() style.Style
- func (b *RadioElement) IsCursorNavigable() bool
- func (b *RadioElement) IsDirtyStyle() bool
- func (r *RadioElement) IsDisabled() bool
- func (b *RadioElement) IsHidden() bool
- func (b *RadioElement) Listeners() []PendingListener
- func (b *RadioElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (r *RadioElement) Name() string
- func (b *RadioElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *RadioElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnConnect(fn func()) *Self
- func (b *RadioElement) OnConnected()
- func (b *RadioElement) OnDisconnect(fn func()) *Self
- func (b *RadioElement) OnDisconnected()
- func (b *RadioElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *RadioElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *RadioElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *RadioElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *RadioElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *RadioElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *RadioElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *RadioElement) OnPress(fn func()) *Self
- func (b *RadioElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *RadioElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *RadioElement) RawStyle() style.Style
- func (b *RadioElement) Ref(dst **Self) *Self
- func (b *RadioElement) ResetCaret(dir dom.Direction)
- func (b *RadioElement) ScrollbarX(v bool) *Self
- func (b *RadioElement) ScrollbarY(v bool) *Self
- func (b *RadioElement) SetCursorNavigable(v bool)
- func (r *RadioElement) SetDisabled(v bool)
- func (r *RadioElement) SetGlyphs(unchecked, checked string) *RadioElement
- func (b *RadioElement) SetHidden(v bool)
- func (b *RadioElement) SetStyle(s style.Style)
- func (b *RadioElement) SetText(text string) *Self
- func (b *RadioElement) SetTextf(format string, args ...any) *Self
- func (r *RadioElement) SetValue(value string) *RadioElement
- func (b *RadioElement) Style(s style.Style) *Self
- func (b *RadioElement) Unwrap() dom.Node
- func (r *RadioElement) Value() any
- func (b *RadioElement) WithClass(class string) *Self
- func (b *RadioElement) WithID(id string) *Self
- func (r *RadioElement) WithName(name string) *RadioElement
- func (b *RadioElement) WithTabIndex(index int) *Self
- type RadioGroupElement
- func (rg *RadioGroupElement) AddChild(child dom.Node) *RadioGroupElement
- func (b *RadioGroupElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (rg *RadioGroupElement) AppendChild(child dom.Node) dom.Node
- func (b *RadioGroupElement) CursorNavigable(v bool) *Self
- func (b *RadioGroupElement) DefaultStyle() style.Style
- func (rg *RadioGroupElement) DefaultValue(value string) *RadioGroupElement
- func (rg *RadioGroupElement) Disabled(v bool) *RadioGroupElement
- func (b *RadioGroupElement) DispatchEvent(e event.Event)
- func (b *RadioGroupElement) EventListeners() []PendingListener
- func (b *RadioGroupElement) Hidden(v bool) *Self
- func (b *RadioGroupElement) IntrinsicStyle() style.Style
- func (b *RadioGroupElement) IsCursorNavigable() bool
- func (b *RadioGroupElement) IsDirtyStyle() bool
- func (rg *RadioGroupElement) IsDisabled() bool
- func (b *RadioGroupElement) IsHidden() bool
- func (b *RadioGroupElement) Listeners() []PendingListener
- func (b *RadioGroupElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *RadioGroupElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (rg *RadioGroupElement) OnChange(fn func(string)) *RadioGroupElement
- func (b *RadioGroupElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnConnect(fn func()) *Self
- func (b *RadioGroupElement) OnConnected()
- func (b *RadioGroupElement) OnDisconnect(fn func()) *Self
- func (b *RadioGroupElement) OnDisconnected()
- func (b *RadioGroupElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *RadioGroupElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *RadioGroupElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *RadioGroupElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *RadioGroupElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *RadioGroupElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *RadioGroupElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *RadioGroupElement) OnPress(fn func()) *Self
- func (b *RadioGroupElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *RadioGroupElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *RadioGroupElement) RawStyle() style.Style
- func (b *RadioGroupElement) Ref(dst **Self) *Self
- func (b *RadioGroupElement) ResetCaret(dir dom.Direction)
- func (b *RadioGroupElement) ScrollbarX(v bool) *Self
- func (b *RadioGroupElement) ScrollbarY(v bool) *Self
- func (b *RadioGroupElement) SetCursorNavigable(v bool)
- func (rg *RadioGroupElement) SetDisabled(v bool)
- func (b *RadioGroupElement) SetHidden(v bool)
- func (b *RadioGroupElement) SetStyle(s style.Style)
- func (b *RadioGroupElement) SetText(text string) *Self
- func (b *RadioGroupElement) SetTextf(format string, args ...any) *Self
- func (rg *RadioGroupElement) SetValue(value string) *RadioGroupElement
- func (b *RadioGroupElement) Style(s style.Style) *Self
- func (b *RadioGroupElement) Unwrap() dom.Node
- func (rg *RadioGroupElement) Value() string
- func (b *RadioGroupElement) WithClass(class string) *Self
- func (b *RadioGroupElement) WithID(id string) *Self
- func (b *RadioGroupElement) WithTabIndex(index int) *Self
- type SelectElement
- func (b *SelectElement) AddChild(child dom.Node) *Self
- func (b *SelectElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (s *SelectElement) AppendChild(child dom.Node) dom.Node
- func (b *SelectElement) CursorNavigable(v bool) *Self
- func (b *SelectElement) DefaultStyle() style.Style
- func (s *SelectElement) DefaultValue(value string) *SelectElement
- func (s *SelectElement) Disabled(v bool) *SelectElement
- func (b *SelectElement) DispatchEvent(e event.Event)
- func (b *SelectElement) EventListeners() []PendingListener
- func (b *SelectElement) Hidden(v bool) *Self
- func (b *SelectElement) IntrinsicStyle() style.Style
- func (b *SelectElement) IsCursorNavigable() bool
- func (b *SelectElement) IsDirtyStyle() bool
- func (s *SelectElement) IsDisabled() bool
- func (b *SelectElement) IsHidden() bool
- func (b *SelectElement) Listeners() []PendingListener
- func (b *SelectElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (s *SelectElement) Name() string
- func (b *SelectElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (s *SelectElement) OnChange(fn func(string)) *SelectElement
- func (b *SelectElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnConnect(fn func()) *Self
- func (b *SelectElement) OnConnected()
- func (b *SelectElement) OnDisconnect(fn func()) *Self
- func (b *SelectElement) OnDisconnected()
- func (b *SelectElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *SelectElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *SelectElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *SelectElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *SelectElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *SelectElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *SelectElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *SelectElement) OnPress(fn func()) *Self
- func (b *SelectElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *SelectElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *SelectElement) RawStyle() style.Style
- func (b *SelectElement) Ref(dst **Self) *Self
- func (s *SelectElement) RemoveChild(child dom.Node) dom.Node
- func (b *SelectElement) ResetCaret(dir dom.Direction)
- func (b *SelectElement) ScrollbarX(v bool) *Self
- func (b *SelectElement) ScrollbarY(v bool) *Self
- func (b *SelectElement) SetCursorNavigable(v bool)
- func (s *SelectElement) SetData(data string)
- func (s *SelectElement) SetDisabled(v bool)
- func (b *SelectElement) SetHidden(v bool)
- func (s *SelectElement) SetOptions(options []*OptionElement) *SelectElement
- func (b *SelectElement) SetStyle(s style.Style)
- func (b *SelectElement) SetText(text string) *Self
- func (b *SelectElement) SetTextf(format string, args ...any) *Self
- func (s *SelectElement) SetValue(value string) *SelectElement
- func (b *SelectElement) Style(s style.Style) *Self
- func (b *SelectElement) Unwrap() dom.Node
- func (s *SelectElement) Value() any
- func (b *SelectElement) WithClass(class string) *Self
- func (b *SelectElement) WithID(id string) *Self
- func (s *SelectElement) WithName(name string) *SelectElement
- func (b *SelectElement) WithTabIndex(index int) *Self
- type SpanElement
- func (b *SpanElement) AddChild(child dom.Node) *Self
- func (b *SpanElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *SpanElement) CursorNavigable(v bool) *Self
- func (b *SpanElement) DefaultStyle() style.Style
- func (b *SpanElement) DispatchEvent(e event.Event)
- func (b *SpanElement) EventListeners() []PendingListener
- func (b *SpanElement) Hidden(v bool) *Self
- func (b *SpanElement) IntrinsicStyle() style.Style
- func (b *SpanElement) IsCursorNavigable() bool
- func (b *SpanElement) IsDirtyStyle() bool
- func (b *SpanElement) IsHidden() bool
- func (b *SpanElement) Listeners() []PendingListener
- func (b *SpanElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *SpanElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *SpanElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnConnect(fn func()) *Self
- func (b *SpanElement) OnConnected()
- func (b *SpanElement) OnDisconnect(fn func()) *Self
- func (b *SpanElement) OnDisconnected()
- func (b *SpanElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *SpanElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *SpanElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *SpanElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *SpanElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *SpanElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *SpanElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *SpanElement) OnPress(fn func()) *Self
- func (b *SpanElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *SpanElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *SpanElement) RawStyle() style.Style
- func (b *SpanElement) Ref(dst **Self) *Self
- func (b *SpanElement) ResetCaret(dir dom.Direction)
- func (b *SpanElement) ScrollbarX(v bool) *Self
- func (b *SpanElement) ScrollbarY(v bool) *Self
- func (b *SpanElement) SetCursorNavigable(v bool)
- func (b *SpanElement) SetHidden(v bool)
- func (b *SpanElement) SetStyle(s style.Style)
- func (b *SpanElement) SetText(text string) *Self
- func (b *SpanElement) SetTextf(format string, args ...any) *Self
- func (b *SpanElement) Style(s style.Style) *Self
- func (b *SpanElement) Unwrap() dom.Node
- func (b *SpanElement) WithClass(class string) *Self
- func (b *SpanElement) WithID(id string) *Self
- func (b *SpanElement) WithTabIndex(index int) *Self
- type TableBodyElement
- func (b *TableBodyElement) AddChild(child dom.Node) *Self
- func (b *TableBodyElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *TableBodyElement) CursorNavigable(v bool) *Self
- func (b *TableBodyElement) DefaultStyle() style.Style
- func (b *TableBodyElement) DispatchEvent(e event.Event)
- func (b *TableBodyElement) EventListeners() []PendingListener
- func (b *TableBodyElement) Hidden(v bool) *Self
- func (b *TableBodyElement) IntrinsicStyle() style.Style
- func (b *TableBodyElement) IsCursorNavigable() bool
- func (b *TableBodyElement) IsDirtyStyle() bool
- func (b *TableBodyElement) IsHidden() bool
- func (b *TableBodyElement) Listeners() []PendingListener
- func (b *TableBodyElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableBodyElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableBodyElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnConnect(fn func()) *Self
- func (b *TableBodyElement) OnConnected()
- func (b *TableBodyElement) OnDisconnect(fn func()) *Self
- func (b *TableBodyElement) OnDisconnected()
- func (b *TableBodyElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableBodyElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableBodyElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableBodyElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableBodyElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableBodyElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableBodyElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableBodyElement) OnPress(fn func()) *Self
- func (b *TableBodyElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableBodyElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableBodyElement) RawStyle() style.Style
- func (b *TableBodyElement) Ref(dst **Self) *Self
- func (b *TableBodyElement) ResetCaret(dir dom.Direction)
- func (b *TableBodyElement) ScrollbarX(v bool) *Self
- func (b *TableBodyElement) ScrollbarY(v bool) *Self
- func (b *TableBodyElement) SetCursorNavigable(v bool)
- func (b *TableBodyElement) SetHidden(v bool)
- func (b *TableBodyElement) SetStyle(s style.Style)
- func (b *TableBodyElement) SetText(text string) *Self
- func (b *TableBodyElement) SetTextf(format string, args ...any) *Self
- func (b *TableBodyElement) Style(s style.Style) *Self
- func (b *TableBodyElement) Unwrap() dom.Node
- func (b *TableBodyElement) WithClass(class string) *Self
- func (b *TableBodyElement) WithID(id string) *Self
- func (b *TableBodyElement) WithTabIndex(index int) *Self
- type TableCellElement
- func (b *TableCellElement) AddChild(child dom.Node) *Self
- func (b *TableCellElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (td *TableCellElement) ColSpan() int
- func (b *TableCellElement) CursorNavigable(v bool) *Self
- func (b *TableCellElement) DefaultStyle() style.Style
- func (b *TableCellElement) DispatchEvent(e event.Event)
- func (b *TableCellElement) EventListeners() []PendingListener
- func (b *TableCellElement) Hidden(v bool) *Self
- func (b *TableCellElement) IntrinsicStyle() style.Style
- func (b *TableCellElement) IsCursorNavigable() bool
- func (b *TableCellElement) IsDirtyStyle() bool
- func (b *TableCellElement) IsHidden() bool
- func (b *TableCellElement) Listeners() []PendingListener
- func (b *TableCellElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableCellElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableCellElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnConnect(fn func()) *Self
- func (b *TableCellElement) OnConnected()
- func (b *TableCellElement) OnDisconnect(fn func()) *Self
- func (b *TableCellElement) OnDisconnected()
- func (b *TableCellElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableCellElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableCellElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableCellElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableCellElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableCellElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableCellElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableCellElement) OnPress(fn func()) *Self
- func (b *TableCellElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableCellElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableCellElement) RawStyle() style.Style
- func (b *TableCellElement) Ref(dst **Self) *Self
- func (b *TableCellElement) ResetCaret(dir dom.Direction)
- func (td *TableCellElement) RowSpan() int
- func (b *TableCellElement) ScrollbarX(v bool) *Self
- func (b *TableCellElement) ScrollbarY(v bool) *Self
- func (td *TableCellElement) SetColSpan(span int) *TableCellElement
- func (b *TableCellElement) SetCursorNavigable(v bool)
- func (b *TableCellElement) SetHidden(v bool)
- func (td *TableCellElement) SetRowSpan(span int) *TableCellElement
- func (b *TableCellElement) SetStyle(s style.Style)
- func (b *TableCellElement) SetText(text string) *Self
- func (b *TableCellElement) SetTextf(format string, args ...any) *Self
- func (b *TableCellElement) Style(s style.Style) *Self
- func (b *TableCellElement) Unwrap() dom.Node
- func (b *TableCellElement) WithClass(class string) *Self
- func (b *TableCellElement) WithID(id string) *Self
- func (b *TableCellElement) WithTabIndex(index int) *Self
- type TableElement
- func (b *TableElement) AddChild(child dom.Node) *Self
- func (b *TableElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *TableElement) CursorNavigable(v bool) *Self
- func (b *TableElement) DefaultStyle() style.Style
- func (b *TableElement) DispatchEvent(e event.Event)
- func (b *TableElement) EventListeners() []PendingListener
- func (b *TableElement) Hidden(v bool) *Self
- func (b *TableElement) IntrinsicStyle() style.Style
- func (b *TableElement) IsCursorNavigable() bool
- func (b *TableElement) IsDirtyStyle() bool
- func (b *TableElement) IsHidden() bool
- func (b *TableElement) Listeners() []PendingListener
- func (b *TableElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnConnect(fn func()) *Self
- func (b *TableElement) OnConnected()
- func (b *TableElement) OnDisconnect(fn func()) *Self
- func (b *TableElement) OnDisconnected()
- func (b *TableElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableElement) OnPress(fn func()) *Self
- func (b *TableElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableElement) RawStyle() style.Style
- func (b *TableElement) Ref(dst **Self) *Self
- func (b *TableElement) ResetCaret(dir dom.Direction)
- func (b *TableElement) ScrollbarX(v bool) *Self
- func (b *TableElement) ScrollbarY(v bool) *Self
- func (b *TableElement) SetCursorNavigable(v bool)
- func (b *TableElement) SetHidden(v bool)
- func (b *TableElement) SetStyle(s style.Style)
- func (b *TableElement) SetText(text string) *Self
- func (b *TableElement) SetTextf(format string, args ...any) *Self
- func (b *TableElement) Style(s style.Style) *Self
- func (b *TableElement) Unwrap() dom.Node
- func (b *TableElement) WithClass(class string) *Self
- func (b *TableElement) WithID(id string) *Self
- func (b *TableElement) WithTabIndex(index int) *Self
- type TableFooterElement
- func (b *TableFooterElement) AddChild(child dom.Node) *Self
- func (b *TableFooterElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *TableFooterElement) CursorNavigable(v bool) *Self
- func (b *TableFooterElement) DefaultStyle() style.Style
- func (b *TableFooterElement) DispatchEvent(e event.Event)
- func (b *TableFooterElement) EventListeners() []PendingListener
- func (b *TableFooterElement) Hidden(v bool) *Self
- func (b *TableFooterElement) IntrinsicStyle() style.Style
- func (b *TableFooterElement) IsCursorNavigable() bool
- func (b *TableFooterElement) IsDirtyStyle() bool
- func (b *TableFooterElement) IsHidden() bool
- func (b *TableFooterElement) Listeners() []PendingListener
- func (b *TableFooterElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableFooterElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableFooterElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnConnect(fn func()) *Self
- func (b *TableFooterElement) OnConnected()
- func (b *TableFooterElement) OnDisconnect(fn func()) *Self
- func (b *TableFooterElement) OnDisconnected()
- func (b *TableFooterElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableFooterElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableFooterElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableFooterElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableFooterElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableFooterElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableFooterElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableFooterElement) OnPress(fn func()) *Self
- func (b *TableFooterElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableFooterElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableFooterElement) RawStyle() style.Style
- func (b *TableFooterElement) Ref(dst **Self) *Self
- func (b *TableFooterElement) ResetCaret(dir dom.Direction)
- func (b *TableFooterElement) ScrollbarX(v bool) *Self
- func (b *TableFooterElement) ScrollbarY(v bool) *Self
- func (b *TableFooterElement) SetCursorNavigable(v bool)
- func (b *TableFooterElement) SetHidden(v bool)
- func (b *TableFooterElement) SetStyle(s style.Style)
- func (b *TableFooterElement) SetText(text string) *Self
- func (b *TableFooterElement) SetTextf(format string, args ...any) *Self
- func (b *TableFooterElement) Style(s style.Style) *Self
- func (b *TableFooterElement) Unwrap() dom.Node
- func (b *TableFooterElement) WithClass(class string) *Self
- func (b *TableFooterElement) WithID(id string) *Self
- func (b *TableFooterElement) WithTabIndex(index int) *Self
- type TableHeaderElement
- func (b *TableHeaderElement) AddChild(child dom.Node) *Self
- func (b *TableHeaderElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *TableHeaderElement) CursorNavigable(v bool) *Self
- func (b *TableHeaderElement) DefaultStyle() style.Style
- func (b *TableHeaderElement) DispatchEvent(e event.Event)
- func (b *TableHeaderElement) EventListeners() []PendingListener
- func (b *TableHeaderElement) Hidden(v bool) *Self
- func (b *TableHeaderElement) IntrinsicStyle() style.Style
- func (b *TableHeaderElement) IsCursorNavigable() bool
- func (b *TableHeaderElement) IsDirtyStyle() bool
- func (b *TableHeaderElement) IsHidden() bool
- func (b *TableHeaderElement) Listeners() []PendingListener
- func (b *TableHeaderElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableHeaderElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableHeaderElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnConnect(fn func()) *Self
- func (b *TableHeaderElement) OnConnected()
- func (b *TableHeaderElement) OnDisconnect(fn func()) *Self
- func (b *TableHeaderElement) OnDisconnected()
- func (b *TableHeaderElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableHeaderElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableHeaderElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableHeaderElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableHeaderElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableHeaderElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableHeaderElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableHeaderElement) OnPress(fn func()) *Self
- func (b *TableHeaderElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableHeaderElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableHeaderElement) RawStyle() style.Style
- func (b *TableHeaderElement) Ref(dst **Self) *Self
- func (b *TableHeaderElement) ResetCaret(dir dom.Direction)
- func (b *TableHeaderElement) ScrollbarX(v bool) *Self
- func (b *TableHeaderElement) ScrollbarY(v bool) *Self
- func (b *TableHeaderElement) SetCursorNavigable(v bool)
- func (b *TableHeaderElement) SetHidden(v bool)
- func (b *TableHeaderElement) SetStyle(s style.Style)
- func (b *TableHeaderElement) SetText(text string) *Self
- func (b *TableHeaderElement) SetTextf(format string, args ...any) *Self
- func (b *TableHeaderElement) Style(s style.Style) *Self
- func (b *TableHeaderElement) Unwrap() dom.Node
- func (b *TableHeaderElement) WithClass(class string) *Self
- func (b *TableHeaderElement) WithID(id string) *Self
- func (b *TableHeaderElement) WithTabIndex(index int) *Self
- type TableRowElement
- func (b *TableRowElement) AddChild(child dom.Node) *Self
- func (b *TableRowElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *TableRowElement) CursorNavigable(v bool) *Self
- func (b *TableRowElement) DefaultStyle() style.Style
- func (b *TableRowElement) DispatchEvent(e event.Event)
- func (b *TableRowElement) EventListeners() []PendingListener
- func (b *TableRowElement) Hidden(v bool) *Self
- func (b *TableRowElement) IntrinsicStyle() style.Style
- func (b *TableRowElement) IsCursorNavigable() bool
- func (b *TableRowElement) IsDirtyStyle() bool
- func (b *TableRowElement) IsHidden() bool
- func (b *TableRowElement) Listeners() []PendingListener
- func (b *TableRowElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *TableRowElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *TableRowElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnConnect(fn func()) *Self
- func (b *TableRowElement) OnConnected()
- func (b *TableRowElement) OnDisconnect(fn func()) *Self
- func (b *TableRowElement) OnDisconnected()
- func (b *TableRowElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TableRowElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TableRowElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TableRowElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TableRowElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TableRowElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TableRowElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TableRowElement) OnPress(fn func()) *Self
- func (b *TableRowElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *TableRowElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TableRowElement) RawStyle() style.Style
- func (b *TableRowElement) Ref(dst **Self) *Self
- func (b *TableRowElement) ResetCaret(dir dom.Direction)
- func (b *TableRowElement) ScrollbarX(v bool) *Self
- func (b *TableRowElement) ScrollbarY(v bool) *Self
- func (b *TableRowElement) SetCursorNavigable(v bool)
- func (b *TableRowElement) SetHidden(v bool)
- func (b *TableRowElement) SetStyle(s style.Style)
- func (b *TableRowElement) SetText(text string) *Self
- func (b *TableRowElement) SetTextf(format string, args ...any) *Self
- func (b *TableRowElement) Style(s style.Style) *Self
- func (b *TableRowElement) Unwrap() dom.Node
- func (b *TableRowElement) WithClass(class string) *Self
- func (b *TableRowElement) WithID(id string) *Self
- func (b *TableRowElement) WithTabIndex(index int) *Self
- type TextAreaElement
- func (b *TextAreaElement) AddChild(child dom.Node) *Self
- func (b *TextAreaElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (txa *TextAreaElement) Blur()
- func (txa *TextAreaElement) Buffer() *text.Buffer
- func (b *TextAreaElement) CursorNavigable(v bool) *Self
- func (b *TextAreaElement) DefaultStyle() style.Style
- func (txa *TextAreaElement) Disabled(v bool) *TextAreaElement
- func (b *TextAreaElement) DispatchEvent(e event.Event)
- func (b *TextAreaElement) EventListeners() []PendingListener
- func (txa *TextAreaElement) Focus()
- func (b *TextAreaElement) Hidden(v bool) *Self
- func (txa *TextAreaElement) IntrinsicStyle() style.Style
- func (b *TextAreaElement) IsCursorNavigable() bool
- func (b *TextAreaElement) IsDirtyStyle() bool
- func (txa *TextAreaElement) IsDisabled() bool
- func (txa *TextAreaElement) IsFocusable() bool
- func (b *TextAreaElement) IsHidden() bool
- func (b *TextAreaElement) Listeners() []PendingListener
- func (b *TextAreaElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (txa *TextAreaElement) Name() string
- func (b *TextAreaElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (txa *TextAreaElement) OnChange(fn func(string)) *TextAreaElement
- func (b *TextAreaElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnConnect(fn func()) *Self
- func (b *TextAreaElement) OnConnected()
- func (b *TextAreaElement) OnDisconnect(fn func()) *Self
- func (b *TextAreaElement) OnDisconnected()
- func (b *TextAreaElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *TextAreaElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *TextAreaElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *TextAreaElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *TextAreaElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *TextAreaElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *TextAreaElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *TextAreaElement) OnPress(fn func()) *Self
- func (b *TextAreaElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (txa *TextAreaElement) OnWheel(e *event.WheelEvent)
- func (b *TextAreaElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *TextAreaElement) RawStyle() style.Style
- func (b *TextAreaElement) Ref(dst **Self) *Self
- func (b *TextAreaElement) ResetCaret(dir dom.Direction)
- func (b *TextAreaElement) ScrollbarX(v bool) *Self
- func (b *TextAreaElement) ScrollbarY(v bool) *Self
- func (b *TextAreaElement) SetCursorNavigable(v bool)
- func (txa *TextAreaElement) SetDisabled(v bool)
- func (b *TextAreaElement) SetHidden(v bool)
- func (b *TextAreaElement) SetStyle(s style.Style)
- func (b *TextAreaElement) SetText(text string) *Self
- func (b *TextAreaElement) SetTextf(format string, args ...any) *Self
- func (txa *TextAreaElement) SetValue(v string) *TextAreaElement
- func (b *TextAreaElement) Style(s style.Style) *Self
- func (txa *TextAreaElement) SyncBuffer()
- func (txa *TextAreaElement) Text() string
- func (txa *TextAreaElement) TextContent() string
- func (b *TextAreaElement) Unwrap() dom.Node
- func (txa *TextAreaElement) Value() any
- func (b *TextAreaElement) WithClass(class string) *Self
- func (b *TextAreaElement) WithID(id string) *Self
- func (txa *TextAreaElement) WithName(name string) *TextAreaElement
- func (txa *TextAreaElement) WithPlaceholder(p string) *TextAreaElement
- func (txa *TextAreaElement) WithPlaceholderStyle(s style.Style) *TextAreaElement
- func (b *TextAreaElement) WithTabIndex(index int) *Self
- type TextControlBase
- func (b *TextControlBase[T]) Buffer() *text.Buffer
- func (b *TextControlBase[T]) CaretPosition() geom.Point
- func (b *TextControlBase[T]) HandleDefaultAction(ev event.Event)
- func (b *TextControlBase[T]) InitTextControlBase(host T, ContentElement dom.Element, buf *text.Buffer, isMultiline bool, ...)
- func (b *TextControlBase[T]) ProvidesCursor() bool
- func (b *TextControlBase[T]) ScrollCursorIntoView()
- func (b *TextControlBase[T]) SelectedText() string
- func (b *TextControlBase[T]) SelectionRange() (int, int)
- func (b *TextControlBase[T]) SetSelectionRange(start, end int)
- func (b *TextControlBase[T]) SyncBuffer()
- func (b *TextControlBase[T]) UpdateSelectionRange()
- func (b *TextControlBase[T]) WireTextControlEvents()
- type TextElement
- type UnorderedListElement
- func (b *UnorderedListElement) AddChild(child dom.Node) *Self
- func (b *UnorderedListElement) Animate(from, to style.Style, opts animation.Options) *animation.Playback
- func (b *UnorderedListElement) CursorNavigable(v bool) *Self
- func (b *UnorderedListElement) DefaultStyle() style.Style
- func (b *UnorderedListElement) DispatchEvent(e event.Event)
- func (b *UnorderedListElement) EventListeners() []PendingListener
- func (b *UnorderedListElement) Hidden(v bool) *Self
- func (b *UnorderedListElement) IntrinsicStyle() style.Style
- func (b *UnorderedListElement) IsCursorNavigable() bool
- func (b *UnorderedListElement) IsDirtyStyle() bool
- func (b *UnorderedListElement) IsHidden() bool
- func (b *UnorderedListElement) Listeners() []PendingListener
- func (b *UnorderedListElement) MoveCaret(dir dom.Direction) (boundaryReached bool)
- func (b *UnorderedListElement) OnBlur(fn func(*event.FocusEvent)) *Self
- func (b *UnorderedListElement) OnClick(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnConnect(fn func()) *Self
- func (b *UnorderedListElement) OnConnected()
- func (b *UnorderedListElement) OnDisconnect(fn func()) *Self
- func (b *UnorderedListElement) OnDisconnected()
- func (b *UnorderedListElement) OnEvent(typ event.EventType, fn event.Listener) *Self
- func (b *UnorderedListElement) OnFocus(fn func(*event.FocusEvent)) *Self
- func (b *UnorderedListElement) OnKey(combo string, fn func(*event.KeyEvent)) *Self
- func (b *UnorderedListElement) OnKeyDown(fn func(*event.KeyEvent)) *Self
- func (b *UnorderedListElement) OnKeyPress(fn func(*event.KeyEvent)) *Self
- func (b *UnorderedListElement) OnKeyUp(fn func(*event.KeyEvent)) *Self
- func (b *UnorderedListElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
- func (b *UnorderedListElement) OnPress(fn func()) *Self
- func (b *UnorderedListElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
- func (b *UnorderedListElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
- func (b *UnorderedListElement) RawStyle() style.Style
- func (b *UnorderedListElement) Ref(dst **Self) *Self
- func (b *UnorderedListElement) ResetCaret(dir dom.Direction)
- func (b *UnorderedListElement) ScrollbarX(v bool) *Self
- func (b *UnorderedListElement) ScrollbarY(v bool) *Self
- func (b *UnorderedListElement) SetCursorNavigable(v bool)
- func (b *UnorderedListElement) SetHidden(v bool)
- func (b *UnorderedListElement) SetStyle(s style.Style)
- func (b *UnorderedListElement) SetText(text string) *Self
- func (b *UnorderedListElement) SetTextf(format string, args ...any) *Self
- func (b *UnorderedListElement) Style(s style.Style) *Self
- func (b *UnorderedListElement) Unwrap() dom.Node
- func (b *UnorderedListElement) WithClass(class string) *Self
- func (b *UnorderedListElement) WithID(id string) *Self
- func (b *UnorderedListElement) WithTabIndex(index int) *Self
Examples ¶
Constants ¶
const DefaultPasswordMask = '•'
DefaultPasswordMask is the default masking glyph used when password mode is enabled without an explicit custom mask rune.
Variables ¶
var (
DefaultPlaceholderGray = color.RGBA{136, 136, 136, 255} // #888888
)
Functions ¶
This section is empty.
Types ¶
type BoxElement ¶
type BoxElement struct {
// contains filtered or unexported fields
}
BoxElement represents a generic container element (like a HTML <div>).
func Box ¶
func Box(children ...any) *BoxElement
Box creates a new generic box container with the given children.
Example ¶
package main
import (
"fmt"
"strings"
"github.com/masterkeysrd/kite/dom"
"github.com/masterkeysrd/kite/element"
"github.com/masterkeysrd/kite/style"
"github.com/masterkeysrd/kite/testenv"
)
func printScreen(root dom.Element) {
env := testenv.New(nil, 24, 8)
defer env.Close()
env.Mount(root)
env.Flush()
for line := range strings.SplitSeq(strings.TrimRight(env.DumpText(), " \n"), "\n") {
fmt.Println(strings.TrimSpace(line))
}
}
func main() {
heading := style.S().Bold(true)
panel := element.Box(
element.Box("Inbox").Style(heading),
element.Box("No new messages"),
)
printScreen(panel)
}
Output: Inbox No new messages
func (*BoxElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*BoxElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*BoxElement) CursorNavigable ¶
func (b *BoxElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*BoxElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*BoxElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*BoxElement) EventListeners ¶
func (b *BoxElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*BoxElement) Hidden ¶
func (b *BoxElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*BoxElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*BoxElement) IsCursorNavigable ¶
func (b *BoxElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*BoxElement) IsDirtyStyle ¶
func (b *BoxElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*BoxElement) IsHidden ¶
func (b *BoxElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*BoxElement) Listeners ¶
func (b *BoxElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*BoxElement) OnBlur ¶
func (b *BoxElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*BoxElement) OnClick ¶
func (b *BoxElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*BoxElement) OnConnect ¶
func (b *BoxElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*BoxElement) OnConnected ¶
func (b *BoxElement) OnConnected()
func (*BoxElement) OnDisconnect ¶
func (b *BoxElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*BoxElement) OnDisconnected ¶
func (b *BoxElement) OnDisconnected()
func (*BoxElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*BoxElement) OnFocus ¶
func (b *BoxElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*BoxElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*BoxElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*BoxElement) OnMouseDown ¶
func (b *BoxElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*BoxElement) OnMouseEnter ¶
func (b *BoxElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*BoxElement) OnMouseLeave ¶
func (b *BoxElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*BoxElement) OnMouseMove ¶
func (b *BoxElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*BoxElement) OnMouseUp ¶
func (b *BoxElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*BoxElement) OnPress ¶
func (b *BoxElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*BoxElement) OnSelectionChange ¶
func (b *BoxElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*BoxElement) OnWheelEvent ¶
func (b *BoxElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*BoxElement) Ref ¶
func (b *BoxElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*BoxElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*BoxElement) ScrollbarX ¶
func (b *BoxElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*BoxElement) ScrollbarY ¶
func (b *BoxElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*BoxElement) SetCursorNavigable ¶
func (b *BoxElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*BoxElement) SetHidden ¶
func (b *BoxElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*BoxElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*BoxElement) SetText ¶
func (b *BoxElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*BoxElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*BoxElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*BoxElement) WithClass ¶
func (b *BoxElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*BoxElement) WithID ¶
func (b *BoxElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*BoxElement) WithTabIndex ¶
func (b *BoxElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type BrElement ¶
type BrElement struct {
// contains filtered or unexported fields
}
BrElement represents an HTML <br> element: a void inline element that forces a mandatory line break in the inline formatting context (IFC).
Architecture summary:
- Display is "inline" (not a block container).
- The IFC builder detects BrElement via the brElement interface and emits an InlineBr item, which the LineBreaker treats as a forced line end with a '\n' byte cluster so that cursor.FromTextFragment counts the corresponding '\n' byte from the buffer.
- A placeholder BrElement (placeholder == true) is detected via the brPlaceholderElement interface and emits InlineBrPlaceholder instead. The placeholder contributes ZERO bytes to the cursor offset model — it only ensures the IFC produces an empty trailing line when the buffer value ends with '\n', matching the browser's <br id="placeholder"> convention.
This is used by TextAreaElement's UA shadow subtree to represent newlines inserted via the Enter key, matching the HTML spec model.
func NewBr ¶
NewBr creates a new content BrElement owned by doc. It represents a '\n' character in the buffer.
func NewPlaceholderBr ¶
NewPlaceholderBr creates a trailing placeholder BrElement owned by doc. It forces an empty line in the IFC but contributes ZERO bytes to the cursor byte-offset model — it is never backed by a '\n' in the buffer.
func (*BrElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*BrElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*BrElement) CursorNavigable ¶
func (b *BrElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*BrElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*BrElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*BrElement) EventListeners ¶
func (b *BrElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*BrElement) Hidden ¶
func (b *BrElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*BrElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated style for <br>.
func (*BrElement) IsBr ¶
IsBr implements the layout.brElement interface. Returns true only for content brs (not placeholders), so the IFC emits a '\n' byte cluster.
func (*BrElement) IsCursorNavigable ¶
func (b *BrElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*BrElement) IsDirtyStyle ¶
func (b *BrElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*BrElement) IsFocusable ¶
IsFocusable returns false: <br> is never a focus target.
func (*BrElement) IsHidden ¶
func (b *BrElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*BrElement) IsPlaceholderBr ¶
IsPlaceholderBr implements the layout.brPlaceholderElement interface. Returns true only for placeholder brs, so the IFC sets hadForcedBreakAtEnd without emitting any byte cluster.
func (*BrElement) Listeners ¶
func (b *BrElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*BrElement) OnBlur ¶
func (b *BrElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*BrElement) OnClick ¶
func (b *BrElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*BrElement) OnConnect ¶
func (b *BrElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*BrElement) OnConnected ¶
func (b *BrElement) OnConnected()
func (*BrElement) OnDisconnect ¶
func (b *BrElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*BrElement) OnDisconnected ¶
func (b *BrElement) OnDisconnected()
func (*BrElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*BrElement) OnFocus ¶
func (b *BrElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*BrElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*BrElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*BrElement) OnMouseDown ¶
func (b *BrElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*BrElement) OnMouseEnter ¶
func (b *BrElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*BrElement) OnMouseLeave ¶
func (b *BrElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*BrElement) OnMouseMove ¶
func (b *BrElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*BrElement) OnMouseUp ¶
func (b *BrElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*BrElement) OnPress ¶
func (b *BrElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*BrElement) OnSelectionChange ¶
func (b *BrElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*BrElement) OnWheelEvent ¶
func (b *BrElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*BrElement) Ref ¶
func (b *BrElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*BrElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*BrElement) ScrollbarX ¶
func (b *BrElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*BrElement) ScrollbarY ¶
func (b *BrElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*BrElement) SetCursorNavigable ¶
func (b *BrElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*BrElement) SetHidden ¶
func (b *BrElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*BrElement) SetText ¶
func (b *BrElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*BrElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*BrElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*BrElement) WithClass ¶
func (b *BrElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*BrElement) WithID ¶
func (b *BrElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*BrElement) WithTabIndex ¶
func (b *BrElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type ButtonElement ¶
type ButtonElement struct {
// contains filtered or unexported fields
}
ButtonElement implements a clickable button component.
func Button ¶
func Button(children ...any) *ButtonElement
Button creates a new ButtonElement with the given children.
func NewButton ¶
func NewButton(doc dom.Document, children ...any) *ButtonElement
NewButton creates a new ButtonElement owned by doc.
func (*ButtonElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*ButtonElement) Animate ¶
func (b *ButtonElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*ButtonElement) ButtonType ¶
func (b *ButtonElement) ButtonType() string
ButtonType returns the type of the button.
func (*ButtonElement) CursorNavigable ¶
func (b *ButtonElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*ButtonElement) DefaultStyle ¶
func (b *ButtonElement) DefaultStyle() style.Style
DefaultStyle returns the element's default style, including dynamic state.
func (*ButtonElement) Disabled ¶
func (b *ButtonElement) Disabled(v bool) *ButtonElement
func (*ButtonElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*ButtonElement) EventListeners ¶
func (b *ButtonElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*ButtonElement) Hidden ¶
func (b *ButtonElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*ButtonElement) IntrinsicStyle ¶
func (b *ButtonElement) IntrinsicStyle() style.Style
func (*ButtonElement) IsCursorNavigable ¶
func (b *ButtonElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*ButtonElement) IsDirtyStyle ¶
func (b *ButtonElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*ButtonElement) IsDisabled ¶
func (b *ButtonElement) IsDisabled() bool
func (*ButtonElement) IsHidden ¶
func (b *ButtonElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*ButtonElement) Listeners ¶
func (b *ButtonElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*ButtonElement) OnBlur ¶
func (b *ButtonElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*ButtonElement) OnClick ¶
func (b *ButtonElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*ButtonElement) OnConnect ¶
func (b *ButtonElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*ButtonElement) OnConnected ¶
func (b *ButtonElement) OnConnected()
func (*ButtonElement) OnDisconnect ¶
func (b *ButtonElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*ButtonElement) OnDisconnected ¶
func (b *ButtonElement) OnDisconnected()
func (*ButtonElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*ButtonElement) OnFocus ¶
func (b *ButtonElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*ButtonElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*ButtonElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*ButtonElement) OnMouseDown ¶
func (b *ButtonElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*ButtonElement) OnMouseEnter ¶
func (b *ButtonElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*ButtonElement) OnMouseLeave ¶
func (b *ButtonElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*ButtonElement) OnMouseMove ¶
func (b *ButtonElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*ButtonElement) OnMouseUp ¶
func (b *ButtonElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*ButtonElement) OnPress ¶
func (b *ButtonElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*ButtonElement) OnSelectionChange ¶
func (b *ButtonElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*ButtonElement) OnWheelEvent ¶
func (b *ButtonElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*ButtonElement) Ref ¶
func (b *ButtonElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*ButtonElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*ButtonElement) ScrollbarX ¶
func (b *ButtonElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*ButtonElement) ScrollbarY ¶
func (b *ButtonElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*ButtonElement) SetActive ¶
func (b *ButtonElement) SetActive(active bool)
SetActive sets the button's active (pressed) state.
func (*ButtonElement) SetCursorNavigable ¶
func (b *ButtonElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*ButtonElement) SetData ¶
func (b *ButtonElement) SetData(data string)
SetData replaces the button's children with a single text node containing data.
func (*ButtonElement) SetDisabled ¶
func (b *ButtonElement) SetDisabled(v bool)
func (*ButtonElement) SetHidden ¶
func (b *ButtonElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*ButtonElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*ButtonElement) SetText ¶
func (b *ButtonElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*ButtonElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*ButtonElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*ButtonElement) Type ¶
func (b *ButtonElement) Type(btnType string) *ButtonElement
Type sets the button type (e.g. "button", "submit") and returns the ButtonElement.
func (*ButtonElement) WithClass ¶
func (b *ButtonElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*ButtonElement) WithID ¶
func (b *ButtonElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*ButtonElement) WithTabIndex ¶
func (b *ButtonElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type CaretController ¶
type CaretController struct {
Element dom.Element
Offset int
// contains filtered or unexported fields
}
CaretController tracks cursor state and detects transitions across element boundaries.
type CheckboxElement ¶
type CheckboxElement struct {
// contains filtered or unexported fields
}
CheckboxElement implements a toggleable checkbox component.
func Checkbox ¶
func Checkbox(checked bool) *CheckboxElement
Checkbox creates a new CheckboxElement with the given checked state.
func NewCheckbox ¶
func NewCheckbox(doc dom.Document, checked bool) *CheckboxElement
NewCheckbox creates a new CheckboxElement owned by doc.
func (*CheckboxElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*CheckboxElement) Animate ¶
func (b *CheckboxElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*CheckboxElement) Checked ¶
func (c *CheckboxElement) Checked() bool
Checked reports whether the checkbox is checked.
func (*CheckboxElement) CursorNavigable ¶
func (b *CheckboxElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*CheckboxElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*CheckboxElement) Disabled ¶
func (c *CheckboxElement) Disabled(v bool) *CheckboxElement
func (*CheckboxElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*CheckboxElement) EventListeners ¶
func (b *CheckboxElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*CheckboxElement) Hidden ¶
func (b *CheckboxElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*CheckboxElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*CheckboxElement) IsCursorNavigable ¶
func (b *CheckboxElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*CheckboxElement) IsDirtyStyle ¶
func (b *CheckboxElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*CheckboxElement) IsDisabled ¶
func (c *CheckboxElement) IsDisabled() bool
func (*CheckboxElement) IsHidden ¶
func (b *CheckboxElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*CheckboxElement) Listeners ¶
func (b *CheckboxElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*CheckboxElement) Name ¶
func (c *CheckboxElement) Name() string
Name returns the form control name.
func (*CheckboxElement) OnBlur ¶
func (b *CheckboxElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*CheckboxElement) OnChange ¶
func (c *CheckboxElement) OnChange(fn func(bool)) *CheckboxElement
OnChange registers a callback invoked with the new checked state on user toggle (click or Space), never on programmatic SetChecked calls.
func (*CheckboxElement) OnClick ¶
func (b *CheckboxElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*CheckboxElement) OnConnect ¶
func (b *CheckboxElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*CheckboxElement) OnConnected ¶
func (b *CheckboxElement) OnConnected()
func (*CheckboxElement) OnDisconnect ¶
func (b *CheckboxElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*CheckboxElement) OnDisconnected ¶
func (b *CheckboxElement) OnDisconnected()
func (*CheckboxElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*CheckboxElement) OnFocus ¶
func (b *CheckboxElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*CheckboxElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*CheckboxElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*CheckboxElement) OnMouseDown ¶
func (b *CheckboxElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*CheckboxElement) OnMouseEnter ¶
func (b *CheckboxElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*CheckboxElement) OnMouseLeave ¶
func (b *CheckboxElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*CheckboxElement) OnMouseMove ¶
func (b *CheckboxElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*CheckboxElement) OnMouseUp ¶
func (b *CheckboxElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*CheckboxElement) OnPress ¶
func (b *CheckboxElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*CheckboxElement) OnSelectionChange ¶
func (b *CheckboxElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*CheckboxElement) OnWheelEvent ¶
func (b *CheckboxElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*CheckboxElement) Ref ¶
func (b *CheckboxElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*CheckboxElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*CheckboxElement) ScrollbarX ¶
func (b *CheckboxElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*CheckboxElement) ScrollbarY ¶
func (b *CheckboxElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*CheckboxElement) SetChecked ¶
func (c *CheckboxElement) SetChecked(checked bool) *CheckboxElement
SetChecked sets the checked state and updates the UI.
func (*CheckboxElement) SetCursorNavigable ¶
func (b *CheckboxElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*CheckboxElement) SetDisabled ¶
func (c *CheckboxElement) SetDisabled(v bool)
func (*CheckboxElement) SetGlyphs ¶
func (c *CheckboxElement) SetGlyphs(unchecked, checked string) *CheckboxElement
SetGlyphs customizes the strings used for unchecked and checked states.
func (*CheckboxElement) SetHidden ¶
func (b *CheckboxElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*CheckboxElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*CheckboxElement) SetText ¶
func (b *CheckboxElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*CheckboxElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*CheckboxElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*CheckboxElement) Value ¶
func (c *CheckboxElement) Value() any
Value returns the checked state of the checkbox.
func (*CheckboxElement) WithClass ¶
func (b *CheckboxElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*CheckboxElement) WithID ¶
func (b *CheckboxElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*CheckboxElement) WithName ¶
func (c *CheckboxElement) WithName(name string) *CheckboxElement
WithName sets the form control name and returns the CheckboxElement.
func (*CheckboxElement) WithTabIndex ¶
func (b *CheckboxElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type DialogElement ¶
type DialogElement struct {
// contains filtered or unexported fields
}
func Dialog ¶
func Dialog(children ...any) *DialogElement
func (*DialogElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*DialogElement) Animate ¶
func (b *DialogElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*DialogElement) CursorNavigable ¶
func (b *DialogElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*DialogElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*DialogElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*DialogElement) EventListeners ¶
func (b *DialogElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*DialogElement) Hidden ¶
func (b *DialogElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*DialogElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*DialogElement) IsCursorNavigable ¶
func (b *DialogElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*DialogElement) IsDirtyStyle ¶
func (b *DialogElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*DialogElement) IsFocusable ¶
func (d *DialogElement) IsFocusable() bool
func (*DialogElement) IsHidden ¶
func (b *DialogElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*DialogElement) Listeners ¶
func (b *DialogElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*DialogElement) OnBlur ¶
func (b *DialogElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*DialogElement) OnClick ¶
func (b *DialogElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*DialogElement) OnConnect ¶
func (b *DialogElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*DialogElement) OnConnected ¶
func (d *DialogElement) OnConnected()
func (*DialogElement) OnDisconnect ¶
func (b *DialogElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*DialogElement) OnDisconnected ¶
func (d *DialogElement) OnDisconnected()
func (*DialogElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*DialogElement) OnFocus ¶
func (b *DialogElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*DialogElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*DialogElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*DialogElement) OnMouseDown ¶
func (b *DialogElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*DialogElement) OnMouseEnter ¶
func (b *DialogElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*DialogElement) OnMouseLeave ¶
func (b *DialogElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*DialogElement) OnMouseMove ¶
func (b *DialogElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*DialogElement) OnMouseUp ¶
func (b *DialogElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*DialogElement) OnPress ¶
func (b *DialogElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*DialogElement) OnSelectionChange ¶
func (b *DialogElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*DialogElement) OnWheel ¶
func (d *DialogElement) OnWheel(e *event.WheelEvent)
OnWheel implements event.Scrollable to trap scroll/wheel events inside the dialog.
func (*DialogElement) OnWheelEvent ¶
func (b *DialogElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*DialogElement) Ref ¶
func (b *DialogElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*DialogElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*DialogElement) ScrollbarX ¶
func (b *DialogElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*DialogElement) ScrollbarY ¶
func (b *DialogElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*DialogElement) SetCursorNavigable ¶
func (b *DialogElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*DialogElement) SetHidden ¶
func (b *DialogElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*DialogElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*DialogElement) SetText ¶
func (b *DialogElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*DialogElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*DialogElement) SetZIndex ¶
func (d *DialogElement) SetZIndex(zIndex int) *DialogElement
SetZIndex updates the dialog's overlay z-index.
func (*DialogElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*DialogElement) WithClass ¶
func (b *DialogElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*DialogElement) WithID ¶
func (b *DialogElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*DialogElement) WithTabIndex ¶
func (b *DialogElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
func (*DialogElement) ZIndex ¶
func (d *DialogElement) ZIndex(zIndex int) *DialogElement
ZIndex updates the dialog's overlay z-index.
type Element ¶
type Element interface {
dom.Element
// RawStyle returns the author-set style for this element.
RawStyle() style.Style
// SetStyle replaces the author-set style for this element and marks style dirty.
SetStyle(s style.Style)
// IsHidden reports whether the element is in the hidden state.
IsHidden() bool
// SetHidden sets or clears the element's hidden state and marks style dirty.
SetHidden(v bool)
// Listeners returns the set of event listeners registered on this element.
Listeners() []PendingListener
// DispatchEvent fires an event that propagates through the DOM tree.
DispatchEvent(e event.Event)
SetCursorNavigable(bool)
IsCursorNavigable() bool
}
Element is the interface satisfied by every native element type. It extends dom.Element so wrapper elements can participate directly in logical-tree APIs while still exposing builder-oriented style and state helpers.
type FormElement ¶
type FormElement struct {
// contains filtered or unexported fields
}
FormElement implements the HTML <form> container element.
func Form ¶
func Form(children ...any) *FormElement
Form creates a new FormElement using the orphan document.
Example ¶
package main
import (
"fmt"
"github.com/masterkeysrd/kite/element"
"github.com/masterkeysrd/kite/event"
"github.com/masterkeysrd/kite/testenv"
)
func main() {
env := testenv.New(nil, 40, 5)
defer env.Close()
save := element.Button("Save").Type("submit")
form := element.Form(
element.Input("Ada").WithName("name"),
element.Checkbox(true).WithName("notify"),
save,
)
form.AddEventListener(event.EventSubmit, func(e event.Event) {
data := e.(*event.SubmitEvent).FormData
fmt.Printf("%s: notifications %v\n", data["name"], data["notify"])
})
env.Mount(form)
env.Flush()
env.ClickElement(save)
}
Output: Ada: notifications true
func NewForm ¶
func NewForm(doc dom.Document, children ...any) *FormElement
NewForm creates a new FormElement owned by doc.
func (*FormElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*FormElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*FormElement) CursorNavigable ¶
func (b *FormElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*FormElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*FormElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*FormElement) EventListeners ¶
func (b *FormElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*FormElement) Hidden ¶
func (b *FormElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*FormElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*FormElement) IsCursorNavigable ¶
func (b *FormElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*FormElement) IsDirtyStyle ¶
func (b *FormElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*FormElement) IsHidden ¶
func (b *FormElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*FormElement) Listeners ¶
func (b *FormElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*FormElement) OnBlur ¶
func (b *FormElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*FormElement) OnClick ¶
func (b *FormElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*FormElement) OnConnect ¶
func (b *FormElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*FormElement) OnConnected ¶
func (b *FormElement) OnConnected()
func (*FormElement) OnDisconnect ¶
func (b *FormElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*FormElement) OnDisconnected ¶
func (b *FormElement) OnDisconnected()
func (*FormElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*FormElement) OnFocus ¶
func (b *FormElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*FormElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*FormElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*FormElement) OnMouseDown ¶
func (b *FormElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*FormElement) OnMouseEnter ¶
func (b *FormElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*FormElement) OnMouseLeave ¶
func (b *FormElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*FormElement) OnMouseMove ¶
func (b *FormElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*FormElement) OnMouseUp ¶
func (b *FormElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*FormElement) OnPress ¶
func (b *FormElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*FormElement) OnSelectionChange ¶
func (b *FormElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*FormElement) OnWheelEvent ¶
func (b *FormElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*FormElement) Ref ¶
func (b *FormElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*FormElement) Reset ¶
func (f *FormElement) Reset()
Reset dispatches a cancelable EventReset and restores all descendant form controls to their initial values unless a listener called PreventDefault.
func (*FormElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*FormElement) ScrollbarX ¶
func (b *FormElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*FormElement) ScrollbarY ¶
func (b *FormElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*FormElement) SetCursorNavigable ¶
func (b *FormElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*FormElement) SetHidden ¶
func (b *FormElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*FormElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*FormElement) SetText ¶
func (b *FormElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*FormElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*FormElement) SetValues ¶
func (f *FormElement) SetValues(values map[string]any)
SetValues updates named descendant form controls from values. Exact name matches take precedence, falling back to case-insensitive matches.
func (*FormElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*FormElement) Submit ¶
func (f *FormElement) Submit()
Submit collects all FormControl values in f's subtree and dispatches EventSubmit.
func (*FormElement) Values ¶
func (f *FormElement) Values() map[string]any
Values collects the current values of all named form controls in f's subtree.
func (*FormElement) WithClass ¶
func (b *FormElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*FormElement) WithID ¶
func (b *FormElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*FormElement) WithTabIndex ¶
func (b *FormElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type FormResetEvent ¶
FormResetEvent is dispatched before a FormElement resets its controls. Calling PreventDefault cancels the reset.
func (*FormResetEvent) AfterReset ¶
func (e *FormResetEvent) AfterReset(fn func())
AfterReset registers fn to run after the form controls have been reset.
type InputElement ¶
type InputElement struct {
TextControlBase[*InputElement]
// contains filtered or unexported fields
}
InputElement is a single-line text-input widget implemented as a UA shadow host (ADR-009).
Architecture summary:
- The host gets a plain render.Box; the standard IFC shapes the text.
- A UA shadow subtree is attached via AttachUARoot(): the structure is ua-input-root → ua-input-div → TextNode. The div is an unconstrained block that grows as the user types; the host clips it via overflow:clip and translates it via ScrollTo/ScrollBy.
- UA-mandated styles live in IntrinsicStyle(): display:inline-block, overflow-x:clip, overflow-y:clip, white-space:nowrap.
- Cursor positioning uses cursor.FromTextFragment on the inner div's fragment, whose direct children are the IFC line-boxes.
- Common text-editing mechanics (CaretPosition, ScrollCursorIntoView, handleMouseDown, handleKeyDown) are implemented by the embedded TextControlBase[InputElement]. See ADR-013, TSK-029.
See ADR-009, ADR-010, ADR-013, TSK-024, TSK-029.
func Input ¶
func Input(initialValue string) *InputElement
Input creates a new InputElement with the given initial value using the orphan document (for use in declarative tree construction).
func NewInput ¶
func NewInput(doc dom.Document, initialValue string) *InputElement
NewInput creates a new InputElement owned by doc with an optional initial value.
func (*InputElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*InputElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*InputElement) Blur ¶
func (inp *InputElement) Blur()
Blur programmatically removes focus from the input element.
func (*InputElement) Buffer ¶
func (inp *InputElement) Buffer() *text.Buffer
Buffer returns the underlying text.Buffer for direct manipulation. After any direct mutation, callers must call SyncBuffer() to propagate the change to the UA text node and the render tree.
func (*InputElement) CursorNavigable ¶
func (b *InputElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*InputElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*InputElement) Disabled ¶
func (inp *InputElement) Disabled(v bool) *InputElement
func (*InputElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*InputElement) EventListeners ¶
func (b *InputElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*InputElement) Focus ¶
func (inp *InputElement) Focus()
Focus programmatically moves focus to the input element.
func (*InputElement) Hidden ¶
func (b *InputElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*InputElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*InputElement) IsCursorNavigable ¶
func (b *InputElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*InputElement) IsDirtyStyle ¶
func (b *InputElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*InputElement) IsDisabled ¶
func (inp *InputElement) IsDisabled() bool
func (*InputElement) IsFocusable ¶
func (inp *InputElement) IsFocusable() bool
IsFocusable always returns true for input elements.
func (*InputElement) IsHidden ¶
func (b *InputElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*InputElement) Listeners ¶
func (b *InputElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*InputElement) Mask ¶
func (inp *InputElement) Mask() rune
Mask returns the active mask rune, or 0 if masking is disabled. When password mode is enabled without a custom mask rune, it returns DefaultPasswordMask ('•').
func (*InputElement) Name ¶
func (inp *InputElement) Name() string
Name returns the form control name.
func (*InputElement) OnBlur ¶
func (b *InputElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*InputElement) OnChange ¶
func (inp *InputElement) OnChange(fn func(string)) *InputElement
OnChange registers a callback invoked with the new text on user-initiated buffer edits, never on programmatic SetValue calls.
func (*InputElement) OnClick ¶
func (b *InputElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*InputElement) OnConnect ¶
func (b *InputElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*InputElement) OnConnected ¶
func (b *InputElement) OnConnected()
func (*InputElement) OnDisconnect ¶
func (b *InputElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*InputElement) OnDisconnected ¶
func (b *InputElement) OnDisconnected()
func (*InputElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*InputElement) OnFocus ¶
func (b *InputElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*InputElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*InputElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*InputElement) OnMouseDown ¶
func (b *InputElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*InputElement) OnMouseEnter ¶
func (b *InputElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*InputElement) OnMouseLeave ¶
func (b *InputElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*InputElement) OnMouseMove ¶
func (b *InputElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*InputElement) OnMouseUp ¶
func (b *InputElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*InputElement) OnPress ¶
func (b *InputElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*InputElement) OnSelectionChange ¶
func (b *InputElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*InputElement) OnWheel ¶
func (inp *InputElement) OnWheel(e *event.WheelEvent)
OnWheel implements event.Scrollable. Input disables wheel scrolling.
func (*InputElement) OnWheelEvent ¶
func (b *InputElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*InputElement) Password ¶
func (inp *InputElement) Password() bool
Password reports whether password display mode is enabled.
func (*InputElement) Ref ¶
func (b *InputElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*InputElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*InputElement) ScrollbarX ¶
func (b *InputElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*InputElement) ScrollbarY ¶
func (b *InputElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*InputElement) SetCursorNavigable ¶
func (b *InputElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*InputElement) SetDisabled ¶
func (inp *InputElement) SetDisabled(v bool)
func (*InputElement) SetHidden ¶
func (b *InputElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*InputElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*InputElement) SetText ¶
func (b *InputElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*InputElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*InputElement) SetValue ¶
func (inp *InputElement) SetValue(v string) *InputElement
SetValue replaces the buffer content with v, repositioning the cursor to the end of the new value.
func (*InputElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*InputElement) SyncBuffer ¶
func (inp *InputElement) SyncBuffer()
SyncBuffer propagates the current buffer state to the UA text node and marks layout dirty. Call this after any direct mutation of Buffer().
func (*InputElement) Text ¶
func (inp *InputElement) Text() string
Text returns the current text value of the input.
func (*InputElement) TextContent ¶
func (inp *InputElement) TextContent() string
TextContent returns the current text value of the input, satisfying the dom.Node interface.
func (*InputElement) Value ¶
func (inp *InputElement) Value() any
Value returns the current text value of the input.
func (*InputElement) WithClass ¶
func (b *InputElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*InputElement) WithID ¶
func (b *InputElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*InputElement) WithMask ¶
func (inp *InputElement) WithMask(r rune) *InputElement
WithMask sets a custom mask rune used to obscure displayed input text and returns the InputElement. Passing 0 clears the custom mask rune.
func (*InputElement) WithName ¶
func (inp *InputElement) WithName(name string) *InputElement
WithName sets the form control name and returns the InputElement.
func (*InputElement) WithPassword ¶
func (inp *InputElement) WithPassword(enabled bool) *InputElement
WithPassword enables or disables password display mode and returns the InputElement. When enabled without an explicit mask rune, DefaultPasswordMask ('•') is used to obscure displayed text.
func (*InputElement) WithPlaceholder ¶
func (inp *InputElement) WithPlaceholder(p string) *InputElement
WithPlaceholder sets the placeholder text and returns the InputElement.
func (*InputElement) WithPlaceholderStyle ¶
func (inp *InputElement) WithPlaceholderStyle(s style.Style) *InputElement
WithPlaceholderStyle sets the style for the placeholder and returns the InputElement.
func (*InputElement) WithTabIndex ¶
func (b *InputElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type LabelElement ¶
type LabelElement struct {
// contains filtered or unexported fields
}
LabelElement represents an HTML <label> caption associated with a form control, either implicitly by wrapping it or explicitly via For(id).
func Label ¶
func Label(children ...any) *LabelElement
Label creates a new LabelElement with the given children.
func NewLabel ¶
func NewLabel(doc dom.Document, children ...any) *LabelElement
NewLabel creates a new LabelElement owned by doc.
func (*LabelElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*LabelElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*LabelElement) Control ¶
func (l *LabelElement) Control() Element
Control returns the labelable form control associated with l, or nil.
func (*LabelElement) CursorNavigable ¶
func (b *LabelElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*LabelElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*LabelElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*LabelElement) EventListeners ¶
func (b *LabelElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*LabelElement) For ¶
func (l *LabelElement) For(id string) *LabelElement
For associates the label with the control whose ID equals id and returns l.
func (*LabelElement) ForID ¶
func (l *LabelElement) ForID() string
ForID returns the explicit target control ID, or "" for implicit association.
func (*LabelElement) Hidden ¶
func (b *LabelElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*LabelElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*LabelElement) IsCursorNavigable ¶
func (b *LabelElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*LabelElement) IsDirtyStyle ¶
func (b *LabelElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*LabelElement) IsHidden ¶
func (b *LabelElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*LabelElement) Listeners ¶
func (b *LabelElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*LabelElement) OnBlur ¶
func (b *LabelElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*LabelElement) OnClick ¶
func (b *LabelElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*LabelElement) OnConnect ¶
func (b *LabelElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*LabelElement) OnConnected ¶
func (b *LabelElement) OnConnected()
func (*LabelElement) OnDisconnect ¶
func (b *LabelElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*LabelElement) OnDisconnected ¶
func (b *LabelElement) OnDisconnected()
func (*LabelElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*LabelElement) OnFocus ¶
func (b *LabelElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*LabelElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*LabelElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*LabelElement) OnMouseDown ¶
func (b *LabelElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*LabelElement) OnMouseEnter ¶
func (b *LabelElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*LabelElement) OnMouseLeave ¶
func (b *LabelElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*LabelElement) OnMouseMove ¶
func (b *LabelElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*LabelElement) OnMouseUp ¶
func (b *LabelElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*LabelElement) OnPress ¶
func (b *LabelElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*LabelElement) OnSelectionChange ¶
func (b *LabelElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*LabelElement) OnWheelEvent ¶
func (b *LabelElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*LabelElement) Ref ¶
func (b *LabelElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*LabelElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*LabelElement) ScrollbarX ¶
func (b *LabelElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*LabelElement) ScrollbarY ¶
func (b *LabelElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*LabelElement) SetCursorNavigable ¶
func (b *LabelElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*LabelElement) SetFor ¶
func (l *LabelElement) SetFor(id string)
SetFor updates the target control ID for explicit label association.
func (*LabelElement) SetHidden ¶
func (b *LabelElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*LabelElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*LabelElement) SetText ¶
func (b *LabelElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*LabelElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*LabelElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*LabelElement) WithClass ¶
func (b *LabelElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*LabelElement) WithID ¶
func (b *LabelElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*LabelElement) WithTabIndex ¶
func (b *LabelElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type ListItemElement ¶
type ListItemElement struct {
// contains filtered or unexported fields
}
ListItemElement represents an item in a list (<li>).
func LI ¶
func LI(children ...any) *ListItemElement
LI creates a new list item with the given children.
func NewListItem ¶
func NewListItem(doc dom.Document) *ListItemElement
NewListItem creates a new list item.
func (*ListItemElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*ListItemElement) Animate ¶
func (b *ListItemElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*ListItemElement) CursorNavigable ¶
func (b *ListItemElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*ListItemElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*ListItemElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*ListItemElement) EventListeners ¶
func (b *ListItemElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*ListItemElement) Hidden ¶
func (b *ListItemElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*ListItemElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*ListItemElement) IsCursorNavigable ¶
func (b *ListItemElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*ListItemElement) IsDirtyStyle ¶
func (b *ListItemElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*ListItemElement) IsHidden ¶
func (b *ListItemElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*ListItemElement) Listeners ¶
func (b *ListItemElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*ListItemElement) OnBlur ¶
func (b *ListItemElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*ListItemElement) OnClick ¶
func (b *ListItemElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*ListItemElement) OnConnect ¶
func (b *ListItemElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*ListItemElement) OnConnected ¶
func (b *ListItemElement) OnConnected()
func (*ListItemElement) OnDisconnect ¶
func (b *ListItemElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*ListItemElement) OnDisconnected ¶
func (b *ListItemElement) OnDisconnected()
func (*ListItemElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*ListItemElement) OnFocus ¶
func (b *ListItemElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*ListItemElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*ListItemElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*ListItemElement) OnMouseDown ¶
func (b *ListItemElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*ListItemElement) OnMouseEnter ¶
func (b *ListItemElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*ListItemElement) OnMouseLeave ¶
func (b *ListItemElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*ListItemElement) OnMouseMove ¶
func (b *ListItemElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*ListItemElement) OnMouseUp ¶
func (b *ListItemElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*ListItemElement) OnPress ¶
func (b *ListItemElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*ListItemElement) OnSelectionChange ¶
func (b *ListItemElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*ListItemElement) OnWheelEvent ¶
func (b *ListItemElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*ListItemElement) Ref ¶
func (b *ListItemElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*ListItemElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*ListItemElement) ScrollbarX ¶
func (b *ListItemElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*ListItemElement) ScrollbarY ¶
func (b *ListItemElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*ListItemElement) SetCursorNavigable ¶
func (b *ListItemElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*ListItemElement) SetHidden ¶
func (b *ListItemElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*ListItemElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*ListItemElement) SetText ¶
func (b *ListItemElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*ListItemElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*ListItemElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*ListItemElement) WithClass ¶
func (b *ListItemElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*ListItemElement) WithID ¶
func (b *ListItemElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*ListItemElement) WithTabIndex ¶
func (b *ListItemElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type OptionElement ¶
type OptionElement struct {
// contains filtered or unexported fields
}
OptionElement represents a single option in a Select component. It is a metadata-only element that does not participate in the main render tree.
func NewOption ¶
func NewOption(doc dom.Document, text, value string) *OptionElement
NewOption creates a new OptionElement owned by doc.
func Option ¶
func Option(text, value string) *OptionElement
Option creates a new OptionElement with the given text and value.
func (*OptionElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*OptionElement) Animate ¶
func (b *OptionElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*OptionElement) CursorNavigable ¶
func (b *OptionElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*OptionElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*OptionElement) Disabled ¶
func (o *OptionElement) Disabled(v bool) *OptionElement
func (*OptionElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*OptionElement) EventListeners ¶
func (b *OptionElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*OptionElement) Hidden ¶
func (b *OptionElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*OptionElement) IntrinsicStyle ¶
func (o *OptionElement) IntrinsicStyle() style.Style
func (*OptionElement) IsCursorNavigable ¶
func (b *OptionElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*OptionElement) IsDirtyStyle ¶
func (b *OptionElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*OptionElement) IsDisabled ¶
func (o *OptionElement) IsDisabled() bool
func (*OptionElement) IsHidden ¶
func (b *OptionElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*OptionElement) Listeners ¶
func (b *OptionElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*OptionElement) OnBlur ¶
func (b *OptionElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*OptionElement) OnClick ¶
func (b *OptionElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*OptionElement) OnConnect ¶
func (b *OptionElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*OptionElement) OnConnected ¶
func (b *OptionElement) OnConnected()
func (*OptionElement) OnDisconnect ¶
func (b *OptionElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*OptionElement) OnDisconnected ¶
func (b *OptionElement) OnDisconnected()
func (*OptionElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*OptionElement) OnFocus ¶
func (b *OptionElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*OptionElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*OptionElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*OptionElement) OnMouseDown ¶
func (b *OptionElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*OptionElement) OnMouseEnter ¶
func (b *OptionElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*OptionElement) OnMouseLeave ¶
func (b *OptionElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*OptionElement) OnMouseMove ¶
func (b *OptionElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*OptionElement) OnMouseUp ¶
func (b *OptionElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*OptionElement) OnPress ¶
func (b *OptionElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*OptionElement) OnSelectionChange ¶
func (b *OptionElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*OptionElement) OnWheelEvent ¶
func (b *OptionElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*OptionElement) Ref ¶
func (b *OptionElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*OptionElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*OptionElement) ScrollbarX ¶
func (b *OptionElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*OptionElement) ScrollbarY ¶
func (b *OptionElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*OptionElement) SetCursorNavigable ¶
func (b *OptionElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*OptionElement) SetDisabled ¶
func (o *OptionElement) SetDisabled(v bool)
func (*OptionElement) SetHidden ¶
func (b *OptionElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*OptionElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*OptionElement) SetText ¶
func (o *OptionElement) SetText(text string) *OptionElement
SetText sets the display text of the option.
func (*OptionElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*OptionElement) SetValue ¶
func (o *OptionElement) SetValue(value string) *OptionElement
SetValue sets the value of the option.
func (*OptionElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*OptionElement) WithClass ¶
func (b *OptionElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*OptionElement) WithID ¶
func (b *OptionElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*OptionElement) WithTabIndex ¶
func (b *OptionElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type OrderedListElement ¶
type OrderedListElement struct {
// contains filtered or unexported fields
}
OrderedListElement represents a list of items where the order matters (<ol>).
func NewOrderedList ¶
func NewOrderedList(doc dom.Document) *OrderedListElement
NewOrderedList creates a new ordered list.
func OL ¶
func OL(children ...any) *OrderedListElement
OL creates a new ordered list with the given children.
Example ¶
package main
import (
"fmt"
"strings"
"github.com/masterkeysrd/kite/dom"
"github.com/masterkeysrd/kite/element"
"github.com/masterkeysrd/kite/testenv"
)
func printScreen(root dom.Element) {
env := testenv.New(nil, 24, 8)
defer env.Close()
env.Mount(root)
env.Flush()
for line := range strings.SplitSeq(strings.TrimRight(env.DumpText(), " \n"), "\n") {
fmt.Println(strings.TrimSpace(line))
}
}
func main() {
list := element.OL(
element.LI("Build"),
element.LI("Test"),
)
printScreen(list)
}
Output: 1. Build 2. Test
func (*OrderedListElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*OrderedListElement) Animate ¶
func (b *OrderedListElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*OrderedListElement) CursorNavigable ¶
func (b *OrderedListElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*OrderedListElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*OrderedListElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*OrderedListElement) EventListeners ¶
func (b *OrderedListElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*OrderedListElement) Hidden ¶
func (b *OrderedListElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*OrderedListElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*OrderedListElement) IsCursorNavigable ¶
func (b *OrderedListElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*OrderedListElement) IsDirtyStyle ¶
func (b *OrderedListElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*OrderedListElement) IsHidden ¶
func (b *OrderedListElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*OrderedListElement) Listeners ¶
func (b *OrderedListElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*OrderedListElement) OnBlur ¶
func (b *OrderedListElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*OrderedListElement) OnClick ¶
func (b *OrderedListElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*OrderedListElement) OnConnect ¶
func (b *OrderedListElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*OrderedListElement) OnConnected ¶
func (b *OrderedListElement) OnConnected()
func (*OrderedListElement) OnDisconnect ¶
func (b *OrderedListElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*OrderedListElement) OnDisconnected ¶
func (b *OrderedListElement) OnDisconnected()
func (*OrderedListElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*OrderedListElement) OnFocus ¶
func (b *OrderedListElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*OrderedListElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*OrderedListElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*OrderedListElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*OrderedListElement) OnMouseDown ¶
func (b *OrderedListElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*OrderedListElement) OnMouseEnter ¶
func (b *OrderedListElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*OrderedListElement) OnMouseLeave ¶
func (b *OrderedListElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*OrderedListElement) OnMouseMove ¶
func (b *OrderedListElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*OrderedListElement) OnMouseUp ¶
func (b *OrderedListElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*OrderedListElement) OnPress ¶
func (b *OrderedListElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*OrderedListElement) OnSelectionChange ¶
func (b *OrderedListElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*OrderedListElement) OnWheelEvent ¶
func (b *OrderedListElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*OrderedListElement) Ref ¶
func (b *OrderedListElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*OrderedListElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*OrderedListElement) ScrollbarX ¶
func (b *OrderedListElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*OrderedListElement) ScrollbarY ¶
func (b *OrderedListElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*OrderedListElement) SetCursorNavigable ¶
func (b *OrderedListElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*OrderedListElement) SetHidden ¶
func (b *OrderedListElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*OrderedListElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*OrderedListElement) SetText ¶
func (b *OrderedListElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*OrderedListElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*OrderedListElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*OrderedListElement) WithClass ¶
func (b *OrderedListElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*OrderedListElement) WithID ¶
func (b *OrderedListElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*OrderedListElement) WithTabIndex ¶
func (b *OrderedListElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type OverlayConfig ¶
type OverlayElement ¶
type OverlayElement struct {
// contains filtered or unexported fields
}
func NewOverlay ¶
func (*OverlayElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*OverlayElement) Anchor ¶
func (o *OverlayElement) Anchor() dom.Node
Anchor implements layout.OverlayLever.
func (*OverlayElement) Animate ¶
func (b *OverlayElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*OverlayElement) CreateRenderObject ¶
func (o *OverlayElement) CreateRenderObject() render.Object
CreateRenderObject implements render.CustomObjectProvider.
func (*OverlayElement) CursorNavigable ¶
func (b *OverlayElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*OverlayElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*OverlayElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*OverlayElement) EventListeners ¶
func (b *OverlayElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*OverlayElement) Flip ¶
func (o *OverlayElement) Flip() bool
Flip implements layout.OverlayLever.
func (*OverlayElement) Hidden ¶
func (b *OverlayElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*OverlayElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*OverlayElement) IsCursorNavigable ¶
func (b *OverlayElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*OverlayElement) IsDirtyStyle ¶
func (b *OverlayElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*OverlayElement) IsHidden ¶
func (b *OverlayElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*OverlayElement) Listeners ¶
func (b *OverlayElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*OverlayElement) OnBlur ¶
func (b *OverlayElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*OverlayElement) OnClick ¶
func (b *OverlayElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*OverlayElement) OnConnect ¶
func (b *OverlayElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*OverlayElement) OnConnected ¶
func (o *OverlayElement) OnConnected()
OnConnected implements dom.Lifecycle.
func (*OverlayElement) OnDisconnect ¶
func (b *OverlayElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*OverlayElement) OnDisconnected ¶
func (o *OverlayElement) OnDisconnected()
OnDisconnected implements dom.Lifecycle.
func (*OverlayElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*OverlayElement) OnFocus ¶
func (b *OverlayElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*OverlayElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*OverlayElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*OverlayElement) OnMouseDown ¶
func (b *OverlayElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*OverlayElement) OnMouseEnter ¶
func (b *OverlayElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*OverlayElement) OnMouseLeave ¶
func (b *OverlayElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*OverlayElement) OnMouseMove ¶
func (b *OverlayElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*OverlayElement) OnMouseUp ¶
func (b *OverlayElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*OverlayElement) OnPress ¶
func (b *OverlayElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*OverlayElement) OnSelectionChange ¶
func (b *OverlayElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*OverlayElement) OnWheelEvent ¶
func (b *OverlayElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*OverlayElement) Placement ¶
func (o *OverlayElement) Placement() geom.Placement
Placement implements layout.OverlayLever.
func (*OverlayElement) Ref ¶
func (b *OverlayElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*OverlayElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*OverlayElement) ScrollbarX ¶
func (b *OverlayElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*OverlayElement) ScrollbarY ¶
func (b *OverlayElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*OverlayElement) SetConfig ¶
func (o *OverlayElement) SetConfig(config OverlayConfig) *OverlayElement
SetConfig updates the overlay element's configuration.
func (*OverlayElement) SetCursorNavigable ¶
func (b *OverlayElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*OverlayElement) SetHidden ¶
func (b *OverlayElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*OverlayElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*OverlayElement) SetText ¶
func (b *OverlayElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*OverlayElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*OverlayElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*OverlayElement) WithAnchor ¶
func (o *OverlayElement) WithAnchor(a dom.Element) *OverlayElement
WithAnchor sets the anchor element for positioning the overlay.
func (*OverlayElement) WithClass ¶
func (b *OverlayElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*OverlayElement) WithFlip ¶
func (o *OverlayElement) WithFlip(flip bool) *OverlayElement
WithFlip configures whether the overlay flips when overflowing the viewport.
func (*OverlayElement) WithID ¶
func (b *OverlayElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*OverlayElement) WithPlacement ¶
func (o *OverlayElement) WithPlacement(p geom.Placement) *OverlayElement
WithPlacement sets the preferred placement relative to the anchor.
func (*OverlayElement) WithTabIndex ¶
func (b *OverlayElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
func (*OverlayElement) WithZIndex ¶
func (o *OverlayElement) WithZIndex(zIndex int) *OverlayElement
WithZIndex sets the overlay's top-layer z-index.
type PendingListener ¶
type PendingListener struct {
// Typ is the event type this listener is registered for.
Typ event.EventType
// Fn is the listener function.
Fn event.Listener
}
PendingListener records an event registration from OnEvent(). It is exported so that the engine's event-target resolver and tests can inspect registered listeners without accessing unexported fields.
type RadioElement ¶
type RadioElement struct {
// contains filtered or unexported fields
}
RadioElement represents a single radio button within a RadioGroup.
func NewRadio ¶
func NewRadio(doc dom.Document, value string) *RadioElement
NewRadio creates a new RadioElement owned by doc with the given value.
func Radio ¶
func Radio(value string) *RadioElement
Radio creates a new RadioElement with the given value.
func (*RadioElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*RadioElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*RadioElement) Checked ¶
func (r *RadioElement) Checked() bool
Checked reports whether the radio button is selected.
func (*RadioElement) CursorNavigable ¶
func (b *RadioElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*RadioElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*RadioElement) Disabled ¶
func (r *RadioElement) Disabled(v bool) *RadioElement
func (*RadioElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*RadioElement) EventListeners ¶
func (b *RadioElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*RadioElement) Hidden ¶
func (b *RadioElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*RadioElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*RadioElement) IsCursorNavigable ¶
func (b *RadioElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*RadioElement) IsDirtyStyle ¶
func (b *RadioElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*RadioElement) IsDisabled ¶
func (r *RadioElement) IsDisabled() bool
func (*RadioElement) IsHidden ¶
func (b *RadioElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*RadioElement) Listeners ¶
func (b *RadioElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*RadioElement) Name ¶
func (r *RadioElement) Name() string
Name returns the form control name.
func (*RadioElement) OnBlur ¶
func (b *RadioElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*RadioElement) OnClick ¶
func (b *RadioElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*RadioElement) OnConnect ¶
func (b *RadioElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*RadioElement) OnConnected ¶
func (b *RadioElement) OnConnected()
func (*RadioElement) OnDisconnect ¶
func (b *RadioElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*RadioElement) OnDisconnected ¶
func (b *RadioElement) OnDisconnected()
func (*RadioElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*RadioElement) OnFocus ¶
func (b *RadioElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*RadioElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*RadioElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*RadioElement) OnMouseDown ¶
func (b *RadioElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*RadioElement) OnMouseEnter ¶
func (b *RadioElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*RadioElement) OnMouseLeave ¶
func (b *RadioElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*RadioElement) OnMouseMove ¶
func (b *RadioElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*RadioElement) OnMouseUp ¶
func (b *RadioElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*RadioElement) OnPress ¶
func (b *RadioElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*RadioElement) OnSelectionChange ¶
func (b *RadioElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*RadioElement) OnWheelEvent ¶
func (b *RadioElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*RadioElement) Ref ¶
func (b *RadioElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*RadioElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*RadioElement) ScrollbarX ¶
func (b *RadioElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*RadioElement) ScrollbarY ¶
func (b *RadioElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*RadioElement) SetCursorNavigable ¶
func (b *RadioElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*RadioElement) SetDisabled ¶
func (r *RadioElement) SetDisabled(v bool)
func (*RadioElement) SetGlyphs ¶
func (r *RadioElement) SetGlyphs(unchecked, checked string) *RadioElement
SetGlyphs customizes the strings used for unchecked and checked states.
func (*RadioElement) SetHidden ¶
func (b *RadioElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*RadioElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*RadioElement) SetText ¶
func (b *RadioElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*RadioElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*RadioElement) SetValue ¶
func (r *RadioElement) SetValue(value string) *RadioElement
SetValue updates the radio button's value.
func (*RadioElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*RadioElement) Value ¶
func (r *RadioElement) Value() any
Value returns the value associated with this radio button.
func (*RadioElement) WithClass ¶
func (b *RadioElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*RadioElement) WithID ¶
func (b *RadioElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*RadioElement) WithName ¶
func (r *RadioElement) WithName(name string) *RadioElement
WithName sets the form control name and returns the RadioElement.
func (*RadioElement) WithTabIndex ¶
func (b *RadioElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type RadioGroupElement ¶
type RadioGroupElement struct {
// contains filtered or unexported fields
}
RadioGroupElement manages a set of RadioElements and ensures only one is selected at a time.
func NewRadioGroup ¶
func NewRadioGroup(doc dom.Document, children ...any) *RadioGroupElement
NewRadioGroup creates a new RadioGroupElement owned by doc.
func RadioGroup ¶
func RadioGroup(children ...any) *RadioGroupElement
RadioGroup creates a new RadioGroupElement with the given children.
func (*RadioGroupElement) AddChild ¶
func (rg *RadioGroupElement) AddChild(child dom.Node) *RadioGroupElement
AddChild overrides elementBase.AddChild to sync new radio children.
func (*RadioGroupElement) Animate ¶
func (b *RadioGroupElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*RadioGroupElement) AppendChild ¶
func (rg *RadioGroupElement) AppendChild(child dom.Node) dom.Node
AppendChild overrides dom.Element.AppendChild to sync new radio children.
func (*RadioGroupElement) CursorNavigable ¶
func (b *RadioGroupElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*RadioGroupElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*RadioGroupElement) DefaultValue ¶
func (rg *RadioGroupElement) DefaultValue(value string) *RadioGroupElement
func (*RadioGroupElement) Disabled ¶
func (rg *RadioGroupElement) Disabled(v bool) *RadioGroupElement
func (*RadioGroupElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*RadioGroupElement) EventListeners ¶
func (b *RadioGroupElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*RadioGroupElement) Hidden ¶
func (b *RadioGroupElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*RadioGroupElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*RadioGroupElement) IsCursorNavigable ¶
func (b *RadioGroupElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*RadioGroupElement) IsDirtyStyle ¶
func (b *RadioGroupElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*RadioGroupElement) IsDisabled ¶
func (rg *RadioGroupElement) IsDisabled() bool
func (*RadioGroupElement) IsHidden ¶
func (b *RadioGroupElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*RadioGroupElement) Listeners ¶
func (b *RadioGroupElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*RadioGroupElement) OnBlur ¶
func (b *RadioGroupElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*RadioGroupElement) OnChange ¶
func (rg *RadioGroupElement) OnChange(fn func(string)) *RadioGroupElement
OnChange sets a callback to be invoked when the selected value changes.
func (*RadioGroupElement) OnClick ¶
func (b *RadioGroupElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*RadioGroupElement) OnConnect ¶
func (b *RadioGroupElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*RadioGroupElement) OnConnected ¶
func (b *RadioGroupElement) OnConnected()
func (*RadioGroupElement) OnDisconnect ¶
func (b *RadioGroupElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*RadioGroupElement) OnDisconnected ¶
func (b *RadioGroupElement) OnDisconnected()
func (*RadioGroupElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*RadioGroupElement) OnFocus ¶
func (b *RadioGroupElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*RadioGroupElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*RadioGroupElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*RadioGroupElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*RadioGroupElement) OnMouseDown ¶
func (b *RadioGroupElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*RadioGroupElement) OnMouseEnter ¶
func (b *RadioGroupElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*RadioGroupElement) OnMouseLeave ¶
func (b *RadioGroupElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*RadioGroupElement) OnMouseMove ¶
func (b *RadioGroupElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*RadioGroupElement) OnMouseUp ¶
func (b *RadioGroupElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*RadioGroupElement) OnPress ¶
func (b *RadioGroupElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*RadioGroupElement) OnSelectionChange ¶
func (b *RadioGroupElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*RadioGroupElement) OnWheelEvent ¶
func (b *RadioGroupElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*RadioGroupElement) Ref ¶
func (b *RadioGroupElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*RadioGroupElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*RadioGroupElement) ScrollbarX ¶
func (b *RadioGroupElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*RadioGroupElement) ScrollbarY ¶
func (b *RadioGroupElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*RadioGroupElement) SetCursorNavigable ¶
func (b *RadioGroupElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*RadioGroupElement) SetDisabled ¶
func (rg *RadioGroupElement) SetDisabled(v bool)
func (*RadioGroupElement) SetHidden ¶
func (b *RadioGroupElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*RadioGroupElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*RadioGroupElement) SetText ¶
func (b *RadioGroupElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*RadioGroupElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*RadioGroupElement) SetValue ¶
func (rg *RadioGroupElement) SetValue(value string) *RadioGroupElement
SetValue updates the selected value and synchronizes all child radio buttons.
func (*RadioGroupElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*RadioGroupElement) Value ¶
func (rg *RadioGroupElement) Value() string
Value returns the currently selected value in the group.
func (*RadioGroupElement) WithClass ¶
func (b *RadioGroupElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*RadioGroupElement) WithID ¶
func (b *RadioGroupElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*RadioGroupElement) WithTabIndex ¶
func (b *RadioGroupElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type SelectElement ¶
type SelectElement struct {
// contains filtered or unexported fields
}
SelectElement implements a dropdown selection component.
func NewSelect ¶
func NewSelect(doc dom.Document, children ...any) *SelectElement
NewSelect creates a new SelectElement owned by doc.
func Select ¶
func Select(children ...any) *SelectElement
Select creates a new SelectElement with the given children.
func (*SelectElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*SelectElement) Animate ¶
func (b *SelectElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*SelectElement) AppendChild ¶
func (s *SelectElement) AppendChild(child dom.Node) dom.Node
AppendChild overrides dom.Element.AppendChild to sync select options.
func (*SelectElement) CursorNavigable ¶
func (b *SelectElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*SelectElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*SelectElement) DefaultValue ¶
func (s *SelectElement) DefaultValue(value string) *SelectElement
func (*SelectElement) Disabled ¶
func (s *SelectElement) Disabled(v bool) *SelectElement
func (*SelectElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*SelectElement) EventListeners ¶
func (b *SelectElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*SelectElement) Hidden ¶
func (b *SelectElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*SelectElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*SelectElement) IsCursorNavigable ¶
func (b *SelectElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*SelectElement) IsDirtyStyle ¶
func (b *SelectElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*SelectElement) IsDisabled ¶
func (s *SelectElement) IsDisabled() bool
func (*SelectElement) IsHidden ¶
func (b *SelectElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*SelectElement) Listeners ¶
func (b *SelectElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*SelectElement) Name ¶
func (s *SelectElement) Name() string
Name returns the form control name.
func (*SelectElement) OnBlur ¶
func (b *SelectElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*SelectElement) OnChange ¶
func (s *SelectElement) OnChange(fn func(string)) *SelectElement
OnChange sets a callback to be invoked when the selection changes.
func (*SelectElement) OnClick ¶
func (b *SelectElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*SelectElement) OnConnect ¶
func (b *SelectElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*SelectElement) OnConnected ¶
func (b *SelectElement) OnConnected()
func (*SelectElement) OnDisconnect ¶
func (b *SelectElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*SelectElement) OnDisconnected ¶
func (b *SelectElement) OnDisconnected()
func (*SelectElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*SelectElement) OnFocus ¶
func (b *SelectElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*SelectElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*SelectElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*SelectElement) OnMouseDown ¶
func (b *SelectElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*SelectElement) OnMouseEnter ¶
func (b *SelectElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*SelectElement) OnMouseLeave ¶
func (b *SelectElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*SelectElement) OnMouseMove ¶
func (b *SelectElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*SelectElement) OnMouseUp ¶
func (b *SelectElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*SelectElement) OnPress ¶
func (b *SelectElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*SelectElement) OnSelectionChange ¶
func (b *SelectElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*SelectElement) OnWheelEvent ¶
func (b *SelectElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*SelectElement) Ref ¶
func (b *SelectElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*SelectElement) RemoveChild ¶
func (s *SelectElement) RemoveChild(child dom.Node) dom.Node
RemoveChild overrides dom.Element.RemoveChild to sync select options.
func (*SelectElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*SelectElement) ScrollbarX ¶
func (b *SelectElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*SelectElement) ScrollbarY ¶
func (b *SelectElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*SelectElement) SetCursorNavigable ¶
func (b *SelectElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*SelectElement) SetData ¶
func (s *SelectElement) SetData(data string)
func (*SelectElement) SetDisabled ¶
func (s *SelectElement) SetDisabled(v bool)
func (*SelectElement) SetHidden ¶
func (b *SelectElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*SelectElement) SetOptions ¶
func (s *SelectElement) SetOptions(options []*OptionElement) *SelectElement
SetOptions updates the list of options available in the dropdown.
func (*SelectElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*SelectElement) SetText ¶
func (b *SelectElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*SelectElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*SelectElement) SetValue ¶
func (s *SelectElement) SetValue(value string) *SelectElement
SetValue updates the selected value and updates the trigger button text.
func (*SelectElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*SelectElement) Value ¶
func (s *SelectElement) Value() any
Value returns the currently selected value.
func (*SelectElement) WithClass ¶
func (b *SelectElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*SelectElement) WithID ¶
func (b *SelectElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*SelectElement) WithName ¶
func (s *SelectElement) WithName(name string) *SelectElement
WithName sets the form control name and returns the SelectElement.
func (*SelectElement) WithTabIndex ¶
func (b *SelectElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type SpanElement ¶
type SpanElement struct {
// contains filtered or unexported fields
}
SpanElement represents an inline container element (like a HTML <span>).
func NewSpan ¶
func NewSpan(doc dom.Document) *SpanElement
NewSpan creates a new inline span container.
func Span ¶
func Span(children ...any) *SpanElement
Span creates a new inline span container with the given children.
func (*SpanElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*SpanElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*SpanElement) CursorNavigable ¶
func (b *SpanElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*SpanElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*SpanElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*SpanElement) EventListeners ¶
func (b *SpanElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*SpanElement) Hidden ¶
func (b *SpanElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*SpanElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*SpanElement) IsCursorNavigable ¶
func (b *SpanElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*SpanElement) IsDirtyStyle ¶
func (b *SpanElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*SpanElement) IsHidden ¶
func (b *SpanElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*SpanElement) Listeners ¶
func (b *SpanElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*SpanElement) OnBlur ¶
func (b *SpanElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*SpanElement) OnClick ¶
func (b *SpanElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*SpanElement) OnConnect ¶
func (b *SpanElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*SpanElement) OnConnected ¶
func (b *SpanElement) OnConnected()
func (*SpanElement) OnDisconnect ¶
func (b *SpanElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*SpanElement) OnDisconnected ¶
func (b *SpanElement) OnDisconnected()
func (*SpanElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*SpanElement) OnFocus ¶
func (b *SpanElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*SpanElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*SpanElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*SpanElement) OnMouseDown ¶
func (b *SpanElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*SpanElement) OnMouseEnter ¶
func (b *SpanElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*SpanElement) OnMouseLeave ¶
func (b *SpanElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*SpanElement) OnMouseMove ¶
func (b *SpanElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*SpanElement) OnMouseUp ¶
func (b *SpanElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*SpanElement) OnPress ¶
func (b *SpanElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*SpanElement) OnSelectionChange ¶
func (b *SpanElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*SpanElement) OnWheelEvent ¶
func (b *SpanElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*SpanElement) Ref ¶
func (b *SpanElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*SpanElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*SpanElement) ScrollbarX ¶
func (b *SpanElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*SpanElement) ScrollbarY ¶
func (b *SpanElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*SpanElement) SetCursorNavigable ¶
func (b *SpanElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*SpanElement) SetHidden ¶
func (b *SpanElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*SpanElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*SpanElement) SetText ¶
func (b *SpanElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*SpanElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*SpanElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*SpanElement) WithClass ¶
func (b *SpanElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*SpanElement) WithID ¶
func (b *SpanElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*SpanElement) WithTabIndex ¶
func (b *SpanElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableBodyElement ¶
type TableBodyElement struct {
// contains filtered or unexported fields
}
TableBodyElement represents a table body group element.
func NewTableBody ¶
func NewTableBody(doc dom.Document) *TableBodyElement
NewTableBody creates a new table body group element.
func TBody ¶
func TBody(children ...any) *TableBodyElement
TBody creates a new table body group element with the given children.
func (*TableBodyElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableBodyElement) Animate ¶
func (b *TableBodyElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableBodyElement) CursorNavigable ¶
func (b *TableBodyElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableBodyElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableBodyElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableBodyElement) EventListeners ¶
func (b *TableBodyElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableBodyElement) Hidden ¶
func (b *TableBodyElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableBodyElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableBodyElement) IsCursorNavigable ¶
func (b *TableBodyElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableBodyElement) IsDirtyStyle ¶
func (b *TableBodyElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableBodyElement) IsHidden ¶
func (b *TableBodyElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableBodyElement) Listeners ¶
func (b *TableBodyElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableBodyElement) OnBlur ¶
func (b *TableBodyElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableBodyElement) OnClick ¶
func (b *TableBodyElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableBodyElement) OnConnect ¶
func (b *TableBodyElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableBodyElement) OnConnected ¶
func (b *TableBodyElement) OnConnected()
func (*TableBodyElement) OnDisconnect ¶
func (b *TableBodyElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableBodyElement) OnDisconnected ¶
func (b *TableBodyElement) OnDisconnected()
func (*TableBodyElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableBodyElement) OnFocus ¶
func (b *TableBodyElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableBodyElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableBodyElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*TableBodyElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableBodyElement) OnMouseDown ¶
func (b *TableBodyElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableBodyElement) OnMouseEnter ¶
func (b *TableBodyElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableBodyElement) OnMouseLeave ¶
func (b *TableBodyElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableBodyElement) OnMouseMove ¶
func (b *TableBodyElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableBodyElement) OnMouseUp ¶
func (b *TableBodyElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableBodyElement) OnPress ¶
func (b *TableBodyElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableBodyElement) OnSelectionChange ¶
func (b *TableBodyElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableBodyElement) OnWheelEvent ¶
func (b *TableBodyElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableBodyElement) Ref ¶
func (b *TableBodyElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableBodyElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableBodyElement) ScrollbarX ¶
func (b *TableBodyElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableBodyElement) ScrollbarY ¶
func (b *TableBodyElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableBodyElement) SetCursorNavigable ¶
func (b *TableBodyElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableBodyElement) SetHidden ¶
func (b *TableBodyElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableBodyElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableBodyElement) SetText ¶
func (b *TableBodyElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableBodyElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableBodyElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableBodyElement) WithClass ¶
func (b *TableBodyElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableBodyElement) WithID ¶
func (b *TableBodyElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableBodyElement) WithTabIndex ¶
func (b *TableBodyElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableCellElement ¶
type TableCellElement struct {
// contains filtered or unexported fields
}
TableCellElement represents a table cell element.
func NewTableCell ¶
func NewTableCell(doc dom.Document) *TableCellElement
NewTableCell creates a new table cell element.
func TD ¶
func TD(children ...any) *TableCellElement
TD creates a new table cell element with the given children.
func (*TableCellElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableCellElement) Animate ¶
func (b *TableCellElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableCellElement) ColSpan ¶
func (td *TableCellElement) ColSpan() int
ColSpan returns the number of columns the cell spans.
func (*TableCellElement) CursorNavigable ¶
func (b *TableCellElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableCellElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableCellElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableCellElement) EventListeners ¶
func (b *TableCellElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableCellElement) Hidden ¶
func (b *TableCellElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableCellElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableCellElement) IsCursorNavigable ¶
func (b *TableCellElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableCellElement) IsDirtyStyle ¶
func (b *TableCellElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableCellElement) IsHidden ¶
func (b *TableCellElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableCellElement) Listeners ¶
func (b *TableCellElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableCellElement) OnBlur ¶
func (b *TableCellElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableCellElement) OnClick ¶
func (b *TableCellElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableCellElement) OnConnect ¶
func (b *TableCellElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableCellElement) OnConnected ¶
func (b *TableCellElement) OnConnected()
func (*TableCellElement) OnDisconnect ¶
func (b *TableCellElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableCellElement) OnDisconnected ¶
func (b *TableCellElement) OnDisconnected()
func (*TableCellElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableCellElement) OnFocus ¶
func (b *TableCellElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableCellElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableCellElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*TableCellElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableCellElement) OnMouseDown ¶
func (b *TableCellElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableCellElement) OnMouseEnter ¶
func (b *TableCellElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableCellElement) OnMouseLeave ¶
func (b *TableCellElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableCellElement) OnMouseMove ¶
func (b *TableCellElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableCellElement) OnMouseUp ¶
func (b *TableCellElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableCellElement) OnPress ¶
func (b *TableCellElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableCellElement) OnSelectionChange ¶
func (b *TableCellElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableCellElement) OnWheelEvent ¶
func (b *TableCellElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableCellElement) Ref ¶
func (b *TableCellElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableCellElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableCellElement) RowSpan ¶
func (td *TableCellElement) RowSpan() int
RowSpan returns the number of rows the cell spans.
func (*TableCellElement) ScrollbarX ¶
func (b *TableCellElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableCellElement) ScrollbarY ¶
func (b *TableCellElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableCellElement) SetColSpan ¶
func (td *TableCellElement) SetColSpan(span int) *TableCellElement
SetColSpan sets the number of columns the cell should span.
func (*TableCellElement) SetCursorNavigable ¶
func (b *TableCellElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableCellElement) SetHidden ¶
func (b *TableCellElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableCellElement) SetRowSpan ¶
func (td *TableCellElement) SetRowSpan(span int) *TableCellElement
SetRowSpan sets the number of rows the cell should span.
func (*TableCellElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableCellElement) SetText ¶
func (b *TableCellElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableCellElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableCellElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableCellElement) WithClass ¶
func (b *TableCellElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableCellElement) WithID ¶
func (b *TableCellElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableCellElement) WithTabIndex ¶
func (b *TableCellElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableElement ¶
type TableElement struct {
// contains filtered or unexported fields
}
TableElement represents a table element.
func Table ¶
func Table(children ...any) *TableElement
Table creates a new table element with the given children.
Example ¶
package main
import (
"fmt"
"strings"
"github.com/masterkeysrd/kite/dom"
"github.com/masterkeysrd/kite/element"
"github.com/masterkeysrd/kite/style"
"github.com/masterkeysrd/kite/testenv"
)
func printScreen(root dom.Element) {
env := testenv.New(nil, 24, 8)
defer env.Close()
env.Mount(root)
env.Flush()
for line := range strings.SplitSeq(strings.TrimRight(env.DumpText(), " \n"), "\n") {
fmt.Println(strings.TrimSpace(line))
}
}
func main() {
cell := style.S().Border(style.SingleBorder())
table := element.Table(
element.THead(element.TR(element.TD("Task").Style(cell))),
element.TBody(element.TR(element.TD("Test").Style(cell))),
)
printScreen(table)
}
Output: ┌────┐ │Task│ ├────┤ │Test│ └────┘
func (*TableElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableElement) Animate ¶
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableElement) CursorNavigable ¶
func (b *TableElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableElement) EventListeners ¶
func (b *TableElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableElement) Hidden ¶
func (b *TableElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableElement) IsCursorNavigable ¶
func (b *TableElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableElement) IsDirtyStyle ¶
func (b *TableElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableElement) IsHidden ¶
func (b *TableElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableElement) Listeners ¶
func (b *TableElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableElement) OnBlur ¶
func (b *TableElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableElement) OnClick ¶
func (b *TableElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableElement) OnConnect ¶
func (b *TableElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableElement) OnConnected ¶
func (b *TableElement) OnConnected()
func (*TableElement) OnDisconnect ¶
func (b *TableElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableElement) OnDisconnected ¶
func (b *TableElement) OnDisconnected()
func (*TableElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableElement) OnFocus ¶
func (b *TableElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableElement) OnMouseDown ¶
func (b *TableElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableElement) OnMouseEnter ¶
func (b *TableElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableElement) OnMouseLeave ¶
func (b *TableElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableElement) OnMouseMove ¶
func (b *TableElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableElement) OnMouseUp ¶
func (b *TableElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableElement) OnPress ¶
func (b *TableElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableElement) OnSelectionChange ¶
func (b *TableElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableElement) OnWheelEvent ¶
func (b *TableElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableElement) Ref ¶
func (b *TableElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableElement) ScrollbarX ¶
func (b *TableElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableElement) ScrollbarY ¶
func (b *TableElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableElement) SetCursorNavigable ¶
func (b *TableElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableElement) SetHidden ¶
func (b *TableElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableElement) SetText ¶
func (b *TableElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableElement) WithClass ¶
func (b *TableElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableElement) WithID ¶
func (b *TableElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableElement) WithTabIndex ¶
func (b *TableElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableFooterElement ¶
type TableFooterElement struct {
// contains filtered or unexported fields
}
TableFooterElement represents a table footer group element.
func NewTableFooter ¶
func NewTableFooter(doc dom.Document) *TableFooterElement
NewTableFooter creates a new table footer group element.
func TFoot ¶
func TFoot(children ...any) *TableFooterElement
TFoot creates a new table footer group element with the given children.
func TableFooter ¶
func TableFooter(children ...any) *TableFooterElement
TableFooter is an alias for TFoot.
func (*TableFooterElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableFooterElement) Animate ¶
func (b *TableFooterElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableFooterElement) CursorNavigable ¶
func (b *TableFooterElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableFooterElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableFooterElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableFooterElement) EventListeners ¶
func (b *TableFooterElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableFooterElement) Hidden ¶
func (b *TableFooterElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableFooterElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableFooterElement) IsCursorNavigable ¶
func (b *TableFooterElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableFooterElement) IsDirtyStyle ¶
func (b *TableFooterElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableFooterElement) IsHidden ¶
func (b *TableFooterElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableFooterElement) Listeners ¶
func (b *TableFooterElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableFooterElement) OnBlur ¶
func (b *TableFooterElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableFooterElement) OnClick ¶
func (b *TableFooterElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableFooterElement) OnConnect ¶
func (b *TableFooterElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableFooterElement) OnConnected ¶
func (b *TableFooterElement) OnConnected()
func (*TableFooterElement) OnDisconnect ¶
func (b *TableFooterElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableFooterElement) OnDisconnected ¶
func (b *TableFooterElement) OnDisconnected()
func (*TableFooterElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableFooterElement) OnFocus ¶
func (b *TableFooterElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableFooterElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableFooterElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*TableFooterElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableFooterElement) OnMouseDown ¶
func (b *TableFooterElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableFooterElement) OnMouseEnter ¶
func (b *TableFooterElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableFooterElement) OnMouseLeave ¶
func (b *TableFooterElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableFooterElement) OnMouseMove ¶
func (b *TableFooterElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableFooterElement) OnMouseUp ¶
func (b *TableFooterElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableFooterElement) OnPress ¶
func (b *TableFooterElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableFooterElement) OnSelectionChange ¶
func (b *TableFooterElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableFooterElement) OnWheelEvent ¶
func (b *TableFooterElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableFooterElement) Ref ¶
func (b *TableFooterElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableFooterElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableFooterElement) ScrollbarX ¶
func (b *TableFooterElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableFooterElement) ScrollbarY ¶
func (b *TableFooterElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableFooterElement) SetCursorNavigable ¶
func (b *TableFooterElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableFooterElement) SetHidden ¶
func (b *TableFooterElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableFooterElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableFooterElement) SetText ¶
func (b *TableFooterElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableFooterElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableFooterElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableFooterElement) WithClass ¶
func (b *TableFooterElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableFooterElement) WithID ¶
func (b *TableFooterElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableFooterElement) WithTabIndex ¶
func (b *TableFooterElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableHeaderElement ¶
type TableHeaderElement struct {
// contains filtered or unexported fields
}
TableHeaderElement represents a table header group element.
func NewTableHeader ¶
func NewTableHeader(doc dom.Document) *TableHeaderElement
NewTableHeader creates a new table header group element.
func THead ¶
func THead(children ...any) *TableHeaderElement
THead creates a new table header group element with the given children.
func TableHeader ¶
func TableHeader(children ...any) *TableHeaderElement
TableHeader is an alias for THead.
func (*TableHeaderElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableHeaderElement) Animate ¶
func (b *TableHeaderElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableHeaderElement) CursorNavigable ¶
func (b *TableHeaderElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableHeaderElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableHeaderElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableHeaderElement) EventListeners ¶
func (b *TableHeaderElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableHeaderElement) Hidden ¶
func (b *TableHeaderElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableHeaderElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableHeaderElement) IsCursorNavigable ¶
func (b *TableHeaderElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableHeaderElement) IsDirtyStyle ¶
func (b *TableHeaderElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableHeaderElement) IsHidden ¶
func (b *TableHeaderElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableHeaderElement) Listeners ¶
func (b *TableHeaderElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableHeaderElement) OnBlur ¶
func (b *TableHeaderElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableHeaderElement) OnClick ¶
func (b *TableHeaderElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableHeaderElement) OnConnect ¶
func (b *TableHeaderElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableHeaderElement) OnConnected ¶
func (b *TableHeaderElement) OnConnected()
func (*TableHeaderElement) OnDisconnect ¶
func (b *TableHeaderElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableHeaderElement) OnDisconnected ¶
func (b *TableHeaderElement) OnDisconnected()
func (*TableHeaderElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableHeaderElement) OnFocus ¶
func (b *TableHeaderElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableHeaderElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableHeaderElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*TableHeaderElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableHeaderElement) OnMouseDown ¶
func (b *TableHeaderElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableHeaderElement) OnMouseEnter ¶
func (b *TableHeaderElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableHeaderElement) OnMouseLeave ¶
func (b *TableHeaderElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableHeaderElement) OnMouseMove ¶
func (b *TableHeaderElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableHeaderElement) OnMouseUp ¶
func (b *TableHeaderElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableHeaderElement) OnPress ¶
func (b *TableHeaderElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableHeaderElement) OnSelectionChange ¶
func (b *TableHeaderElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableHeaderElement) OnWheelEvent ¶
func (b *TableHeaderElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableHeaderElement) Ref ¶
func (b *TableHeaderElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableHeaderElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableHeaderElement) ScrollbarX ¶
func (b *TableHeaderElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableHeaderElement) ScrollbarY ¶
func (b *TableHeaderElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableHeaderElement) SetCursorNavigable ¶
func (b *TableHeaderElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableHeaderElement) SetHidden ¶
func (b *TableHeaderElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableHeaderElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableHeaderElement) SetText ¶
func (b *TableHeaderElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableHeaderElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableHeaderElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableHeaderElement) WithClass ¶
func (b *TableHeaderElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableHeaderElement) WithID ¶
func (b *TableHeaderElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableHeaderElement) WithTabIndex ¶
func (b *TableHeaderElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TableRowElement ¶
type TableRowElement struct {
// contains filtered or unexported fields
}
TableRowElement represents a table row element.
func NewTableRow ¶
func NewTableRow(doc dom.Document) *TableRowElement
NewTableRow creates a new table row element.
func TR ¶
func TR(children ...any) *TableRowElement
TR creates a new table row element with the given children.
func (*TableRowElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TableRowElement) Animate ¶
func (b *TableRowElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TableRowElement) CursorNavigable ¶
func (b *TableRowElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TableRowElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TableRowElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TableRowElement) EventListeners ¶
func (b *TableRowElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TableRowElement) Hidden ¶
func (b *TableRowElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TableRowElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*TableRowElement) IsCursorNavigable ¶
func (b *TableRowElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TableRowElement) IsDirtyStyle ¶
func (b *TableRowElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TableRowElement) IsHidden ¶
func (b *TableRowElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TableRowElement) Listeners ¶
func (b *TableRowElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TableRowElement) OnBlur ¶
func (b *TableRowElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TableRowElement) OnClick ¶
func (b *TableRowElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TableRowElement) OnConnect ¶
func (b *TableRowElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TableRowElement) OnConnected ¶
func (b *TableRowElement) OnConnected()
func (*TableRowElement) OnDisconnect ¶
func (b *TableRowElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TableRowElement) OnDisconnected ¶
func (b *TableRowElement) OnDisconnected()
func (*TableRowElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TableRowElement) OnFocus ¶
func (b *TableRowElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TableRowElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TableRowElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TableRowElement) OnMouseDown ¶
func (b *TableRowElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TableRowElement) OnMouseEnter ¶
func (b *TableRowElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TableRowElement) OnMouseLeave ¶
func (b *TableRowElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TableRowElement) OnMouseMove ¶
func (b *TableRowElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TableRowElement) OnMouseUp ¶
func (b *TableRowElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TableRowElement) OnPress ¶
func (b *TableRowElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TableRowElement) OnSelectionChange ¶
func (b *TableRowElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TableRowElement) OnWheelEvent ¶
func (b *TableRowElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TableRowElement) Ref ¶
func (b *TableRowElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TableRowElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TableRowElement) ScrollbarX ¶
func (b *TableRowElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TableRowElement) ScrollbarY ¶
func (b *TableRowElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TableRowElement) SetCursorNavigable ¶
func (b *TableRowElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TableRowElement) SetHidden ¶
func (b *TableRowElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TableRowElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TableRowElement) SetText ¶
func (b *TableRowElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TableRowElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TableRowElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TableRowElement) WithClass ¶
func (b *TableRowElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TableRowElement) WithID ¶
func (b *TableRowElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TableRowElement) WithTabIndex ¶
func (b *TableRowElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TextAreaElement ¶
type TextAreaElement struct {
TextControlBase[*TextAreaElement]
// contains filtered or unexported fields
}
TextAreaElement is a multi-line text-input widget implemented as a UA shadow host (ADR-009).
func NewTextArea ¶
func NewTextArea(doc dom.Document, initialValue string) *TextAreaElement
NewTextArea creates a new TextAreaElement owned by doc with an optional initial value.
func TextArea ¶
func TextArea(initialValue string) *TextAreaElement
TextArea creates a new TextAreaElement using the orphan document.
func (*TextAreaElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*TextAreaElement) Animate ¶
func (b *TextAreaElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*TextAreaElement) Blur ¶
func (txa *TextAreaElement) Blur()
func (*TextAreaElement) Buffer ¶
func (txa *TextAreaElement) Buffer() *text.Buffer
Buffer returns the underlying text.Buffer.
func (*TextAreaElement) CursorNavigable ¶
func (b *TextAreaElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*TextAreaElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*TextAreaElement) Disabled ¶
func (txa *TextAreaElement) Disabled(v bool) *TextAreaElement
func (*TextAreaElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*TextAreaElement) EventListeners ¶
func (b *TextAreaElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*TextAreaElement) Focus ¶
func (txa *TextAreaElement) Focus()
func (*TextAreaElement) Hidden ¶
func (b *TextAreaElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*TextAreaElement) IntrinsicStyle ¶
func (txa *TextAreaElement) IntrinsicStyle() style.Style
func (*TextAreaElement) IsCursorNavigable ¶
func (b *TextAreaElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*TextAreaElement) IsDirtyStyle ¶
func (b *TextAreaElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*TextAreaElement) IsDisabled ¶
func (txa *TextAreaElement) IsDisabled() bool
func (*TextAreaElement) IsFocusable ¶
func (txa *TextAreaElement) IsFocusable() bool
func (*TextAreaElement) IsHidden ¶
func (b *TextAreaElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*TextAreaElement) Listeners ¶
func (b *TextAreaElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*TextAreaElement) Name ¶
func (txa *TextAreaElement) Name() string
Name returns the form control name.
func (*TextAreaElement) OnBlur ¶
func (b *TextAreaElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*TextAreaElement) OnChange ¶
func (txa *TextAreaElement) OnChange(fn func(string)) *TextAreaElement
OnChange registers a callback invoked with the new text on user-initiated buffer edits, never on programmatic SetValue calls.
func (*TextAreaElement) OnClick ¶
func (b *TextAreaElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*TextAreaElement) OnConnect ¶
func (b *TextAreaElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*TextAreaElement) OnConnected ¶
func (b *TextAreaElement) OnConnected()
func (*TextAreaElement) OnDisconnect ¶
func (b *TextAreaElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*TextAreaElement) OnDisconnected ¶
func (b *TextAreaElement) OnDisconnected()
func (*TextAreaElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*TextAreaElement) OnFocus ¶
func (b *TextAreaElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*TextAreaElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*TextAreaElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*TextAreaElement) OnMouseDown ¶
func (b *TextAreaElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*TextAreaElement) OnMouseEnter ¶
func (b *TextAreaElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*TextAreaElement) OnMouseLeave ¶
func (b *TextAreaElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*TextAreaElement) OnMouseMove ¶
func (b *TextAreaElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*TextAreaElement) OnMouseUp ¶
func (b *TextAreaElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*TextAreaElement) OnPress ¶
func (b *TextAreaElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*TextAreaElement) OnSelectionChange ¶
func (b *TextAreaElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*TextAreaElement) OnWheel ¶
func (txa *TextAreaElement) OnWheel(e *event.WheelEvent)
OnWheel implements event.Scrollable.
func (*TextAreaElement) OnWheelEvent ¶
func (b *TextAreaElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*TextAreaElement) Ref ¶
func (b *TextAreaElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*TextAreaElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*TextAreaElement) ScrollbarX ¶
func (b *TextAreaElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*TextAreaElement) ScrollbarY ¶
func (b *TextAreaElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*TextAreaElement) SetCursorNavigable ¶
func (b *TextAreaElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*TextAreaElement) SetDisabled ¶
func (txa *TextAreaElement) SetDisabled(v bool)
func (*TextAreaElement) SetHidden ¶
func (b *TextAreaElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*TextAreaElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*TextAreaElement) SetText ¶
func (b *TextAreaElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*TextAreaElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*TextAreaElement) SetValue ¶
func (txa *TextAreaElement) SetValue(v string) *TextAreaElement
SetValue replaces the buffer content.
func (*TextAreaElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*TextAreaElement) SyncBuffer ¶
func (txa *TextAreaElement) SyncBuffer()
SyncBuffer propagates the current buffer state to the UA text node.
func (*TextAreaElement) Text ¶
func (txa *TextAreaElement) Text() string
Text returns the current text value of the textarea.
func (*TextAreaElement) TextContent ¶
func (txa *TextAreaElement) TextContent() string
TextContent returns the current text value of the textarea, satisfying the dom.Node interface.
func (*TextAreaElement) Value ¶
func (txa *TextAreaElement) Value() any
Value returns the current text value.
func (*TextAreaElement) WithClass ¶
func (b *TextAreaElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*TextAreaElement) WithID ¶
func (b *TextAreaElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*TextAreaElement) WithName ¶
func (txa *TextAreaElement) WithName(name string) *TextAreaElement
WithName sets the form control name and returns the TextAreaElement.
func (*TextAreaElement) WithPlaceholder ¶
func (txa *TextAreaElement) WithPlaceholder(p string) *TextAreaElement
WithPlaceholder sets the placeholder text and returns the TextAreaElement.
func (*TextAreaElement) WithPlaceholderStyle ¶
func (txa *TextAreaElement) WithPlaceholderStyle(s style.Style) *TextAreaElement
WithPlaceholderStyle sets the style for the placeholder and returns the TextAreaElement.
func (*TextAreaElement) WithTabIndex ¶
func (b *TextAreaElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.
type TextControlBase ¶
type TextControlBase[T Element] struct { ContentElement dom.Element // contains filtered or unexported fields }
func (*TextControlBase[T]) Buffer ¶
func (b *TextControlBase[T]) Buffer() *text.Buffer
Buffer returns the underlying editor buffer.
func (*TextControlBase[T]) CaretPosition ¶
func (b *TextControlBase[T]) CaretPosition() geom.Point
CaretPosition returns the unscrolled caret cell relative to the control's border box.
func (*TextControlBase[T]) HandleDefaultAction ¶
func (b *TextControlBase[T]) HandleDefaultAction(ev event.Event)
HandleDefaultAction performs post-dispatch default actions for the text control (e.g., inserting pasted text) unless a listener called PreventDefault().
func (*TextControlBase[T]) InitTextControlBase ¶
func (b *TextControlBase[T]) InitTextControlBase( host T, ContentElement dom.Element, buf *text.Buffer, isMultiline bool, sync func(), )
InitTextControlBase initialises the base with its dependencies. host is the outer dom.Element (the shadow host for the control). ContentElement is the inner block element whose IFC children form the text layout. buf is the editor buffer. isMultiline distinguishes textarea (true) from input (false). sync is the concrete element's sync callback.
func (*TextControlBase[T]) ProvidesCursor ¶
func (b *TextControlBase[T]) ProvidesCursor() bool
ProvidesCursor implements dom.Element.
func (*TextControlBase[T]) ScrollCursorIntoView ¶
func (b *TextControlBase[T]) ScrollCursorIntoView()
ScrollCursorIntoView implements dom.Element.
func (*TextControlBase[T]) SelectedText ¶
func (b *TextControlBase[T]) SelectedText() string
SelectedText returns the text currently covered by the local selection.
func (*TextControlBase[T]) SelectionRange ¶
func (b *TextControlBase[T]) SelectionRange() (int, int)
SelectionRange returns the current selection start and end byte offsets.
func (*TextControlBase[T]) SetSelectionRange ¶
func (b *TextControlBase[T]) SetSelectionRange(start, end int)
SetSelectionRange sets the selection to the given byte offsets. It moves the cursor to end and triggers a sync.
func (*TextControlBase[T]) SyncBuffer ¶
func (b *TextControlBase[T]) SyncBuffer()
SyncBuffer propagates the current buffer state to the UA text node and marks layout dirty. Call this after any direct mutation of Buffer().
func (*TextControlBase[T]) UpdateSelectionRange ¶
func (b *TextControlBase[T]) UpdateSelectionRange()
UpdateSelectionRange programmatically updates the document's selection based on the control's local selectionStart/selectionEnd offsets. It maps byte offsets to (Node, runeOffset) pairs within the UA subtree.
func (*TextControlBase[T]) WireTextControlEvents ¶
func (b *TextControlBase[T]) WireTextControlEvents()
WireTextControlEvents wires up default key bindings and mouse events.
type TextElement ¶
TextElement represents a text node in the logical tree.
func NewText ¶
func NewText(doc dom.Document, data string) *TextElement
NewText creates a new text node.
func (*TextElement) Data ¶
func (t *TextElement) Data() string
func (*TextElement) SetData ¶
func (t *TextElement) SetData(data string)
func (*TextElement) Unwrap ¶
func (t *TextElement) Unwrap() dom.Node
type UnorderedListElement ¶
type UnorderedListElement struct {
// contains filtered or unexported fields
}
UnorderedListElement represents a list of items where the order does not matter (<ul>).
func NewUnorderedList ¶
func NewUnorderedList(doc dom.Document) *UnorderedListElement
NewUnorderedList creates a new unordered list.
func UL ¶
func UL(children ...any) *UnorderedListElement
UL creates a new unordered list with the given children.
Example ¶
package main
import (
"fmt"
"strings"
"github.com/masterkeysrd/kite/dom"
"github.com/masterkeysrd/kite/element"
"github.com/masterkeysrd/kite/testenv"
)
func printScreen(root dom.Element) {
env := testenv.New(nil, 24, 8)
defer env.Close()
env.Mount(root)
env.Flush()
for line := range strings.SplitSeq(strings.TrimRight(env.DumpText(), " \n"), "\n") {
fmt.Println(strings.TrimSpace(line))
}
}
func main() {
list := element.UL(
element.LI("Tea"),
element.LI("Coffee"),
)
printScreen(list)
}
Output: • Tea • Coffee
func (*UnorderedListElement) AddChild ¶
AddChild adds child as the last child of this element and returns the element itself for fluent chaining.
func (*UnorderedListElement) Animate ¶
func (b *UnorderedListElement) Animate( from, to style.Style, opts animation.Options, ) *animation.Playback
Animate interpolates style properties from start to end on the element over opts.Duration using the document window's frame clock. Unrelated author styles are preserved via sparse merging, and the animation cancels automatically if the element disconnects from the document.
func (*UnorderedListElement) CursorNavigable ¶
func (b *UnorderedListElement) CursorNavigable(v bool) *Self
CursorNavigable enables character-level caret navigation and text selection on this element.
func (*UnorderedListElement) DefaultStyle ¶
DefaultStyle returns the element-type default style.
func (*UnorderedListElement) DispatchEvent ¶
DispatchEvent fires an event that propagates through the DOM tree.
func (*UnorderedListElement) EventListeners ¶
func (b *UnorderedListElement) EventListeners() []PendingListener
EventListeners returns the event listener registrations for this element. Used by the engine's event-target resolver to wire up dispatch.
func (*UnorderedListElement) Hidden ¶
func (b *UnorderedListElement) Hidden(v bool) *Self
Hidden sets or clears the hidden state and returns *Self.
func (*UnorderedListElement) IntrinsicStyle ¶
IntrinsicStyle returns the UA-mandated forced style for this element. Properties set here have the highest cascade precedence; authors cannot override them via Style(). Most elements return an empty style.S(). Replaced and compound elements return a sparse Style with UA-forced properties (e.g. Display:InlineBlock, OverflowX:Clip). See ADR-010.
func (*UnorderedListElement) IsCursorNavigable ¶
func (b *UnorderedListElement) IsCursorNavigable() bool
IsCursorNavigable reports whether the element is cursor-navigable.
func (*UnorderedListElement) IsDirtyStyle ¶
func (b *UnorderedListElement) IsDirtyStyle() bool
IsDirtyStyle reports whether this element's style needs re-resolution.
func (*UnorderedListElement) IsHidden ¶
func (b *UnorderedListElement) IsHidden() bool
IsHidden reports whether the element is hidden.
func (*UnorderedListElement) Listeners ¶
func (b *UnorderedListElement) Listeners() []PendingListener
Listeners returns the set of event listeners registered on this element.
func (*UnorderedListElement) OnBlur ¶
func (b *UnorderedListElement) OnBlur(fn func(*event.FocusEvent)) *Self
OnBlur registers a typed blur listener and returns *Self.
func (*UnorderedListElement) OnClick ¶
func (b *UnorderedListElement) OnClick(fn func(*event.MouseEvent)) *Self
OnClick registers a typed click listener and returns *Self.
func (*UnorderedListElement) OnConnect ¶
func (b *UnorderedListElement) OnConnect(fn func()) *Self
OnConnect registers fn to run each time the element enters the live document.
func (*UnorderedListElement) OnConnected ¶
func (b *UnorderedListElement) OnConnected()
func (*UnorderedListElement) OnDisconnect ¶
func (b *UnorderedListElement) OnDisconnect(fn func()) *Self
OnDisconnect registers fn to run just before the element leaves the live document.
func (*UnorderedListElement) OnDisconnected ¶
func (b *UnorderedListElement) OnDisconnected()
func (*UnorderedListElement) OnEvent ¶
OnEvent registers fn as a listener for event of type typ and returns *Self. Listeners are stored on the element and retrieved by the engine's event-target resolver during dispatch setup. Nil handlers are ignored.
func (*UnorderedListElement) OnFocus ¶
func (b *UnorderedListElement) OnFocus(fn func(*event.FocusEvent)) *Self
OnFocus registers a typed focus listener and returns *Self.
func (*UnorderedListElement) OnKey ¶
OnKey registers a keydown listener filtered by combo via event.KeyEvent.MatchString and returns *Self.
func (*UnorderedListElement) OnKeyDown ¶
OnKeyDown registers a typed keydown listener and returns *Self.
func (*UnorderedListElement) OnKeyPress ¶
OnKeyPress registers a typed keypress listener and returns *Self.
func (*UnorderedListElement) OnMouseDown ¶
func (b *UnorderedListElement) OnMouseDown(fn func(*event.MouseEvent)) *Self
OnMouseDown registers a typed mousedown listener and returns *Self.
func (*UnorderedListElement) OnMouseEnter ¶
func (b *UnorderedListElement) OnMouseEnter(fn func(*event.MouseEvent)) *Self
OnMouseEnter registers a typed mouseenter listener and returns *Self.
func (*UnorderedListElement) OnMouseLeave ¶
func (b *UnorderedListElement) OnMouseLeave(fn func(*event.MouseEvent)) *Self
OnMouseLeave registers a typed mouseleave listener and returns *Self.
func (*UnorderedListElement) OnMouseMove ¶
func (b *UnorderedListElement) OnMouseMove(fn func(*event.MouseEvent)) *Self
OnMouseMove registers a typed mousemove listener and returns *Self.
func (*UnorderedListElement) OnMouseUp ¶
func (b *UnorderedListElement) OnMouseUp(fn func(*event.MouseEvent)) *Self
OnMouseUp registers a typed mouseup listener and returns *Self.
func (*UnorderedListElement) OnPress ¶
func (b *UnorderedListElement) OnPress(fn func()) *Self
OnPress registers a zero-argument activation listener on click (including keyboard Enter/Space activation on buttons) and returns *Self.
func (*UnorderedListElement) OnSelectionChange ¶
func (b *UnorderedListElement) OnSelectionChange(fn func(*event.SelectionChangeEvent)) *Self
OnSelectionChange registers a typed selectionchange listener and returns *Self.
func (*UnorderedListElement) OnWheelEvent ¶
func (b *UnorderedListElement) OnWheelEvent(fn func(*event.WheelEvent)) *Self
OnWheelEvent registers a typed wheel listener and returns *Self. Named OnWheelEvent to avoid colliding with event.Scrollable's OnWheel method.
func (*UnorderedListElement) Ref ¶
func (b *UnorderedListElement) Ref(dst **Self) *Self
Ref stores a pointer to the concrete element into dst (if non-nil) and returns *Self.
func (*UnorderedListElement) ResetCaret ¶
ResetCaret satisfies the dom.SpatialCaret interface.
func (*UnorderedListElement) ScrollbarX ¶
func (b *UnorderedListElement) ScrollbarX(v bool) *Self
ScrollbarX enables or disables the horizontal scrollbar and returns *Self.
func (*UnorderedListElement) ScrollbarY ¶
func (b *UnorderedListElement) ScrollbarY(v bool) *Self
ScrollbarY enables or disables the vertical scrollbar and returns *Self.
func (*UnorderedListElement) SetCursorNavigable ¶
func (b *UnorderedListElement) SetCursorNavigable(v bool)
SetCursorNavigable sets whether the element is cursor-navigable.
func (*UnorderedListElement) SetHidden ¶
func (b *UnorderedListElement) SetHidden(v bool)
SetHidden sets or clears the hidden state and marks style dirty.
func (*UnorderedListElement) SetStyle ¶
SetStyle replaces the element's style wholesale and marks style dirty.
func (*UnorderedListElement) SetText ¶
func (b *UnorderedListElement) SetText(text string) *Self
SetText replaces the element's children with a single text node containing text, updating an existing sole text child in place when possible, and returns *Self.
func (*UnorderedListElement) SetTextf ¶
SetTextf formats text with fmt.Sprintf and passes the result to [SetText].
func (*UnorderedListElement) Style ¶
Style replaces the element's style wholesale and returns *Self. Calling Style twice discards the first call; style composition belongs at the style.Style value level via Style.Merge.
func (*UnorderedListElement) WithClass ¶
func (b *UnorderedListElement) WithClass(class string) *Self
WithClass sets the string classification tag and returns *Self.
func (*UnorderedListElement) WithID ¶
func (b *UnorderedListElement) WithID(id string) *Self
WithID sets the element's identifier and returns *Self.
func (*UnorderedListElement) WithTabIndex ¶
func (b *UnorderedListElement) WithTabIndex(index int) *Self
WithTabIndex sets the tab index on the element and returns *Self.