WASM reactive UI framework for Go: - reactive/ - Signal[T], Effect, Runtime - ui/ - Button, Text, Input, View, Canvas, SVG components - navigation/ - Router, guards, history management - auth/ - OIDC client for WASM applications - host/ - Static file server Extracted from arcadia as open-source component. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
172
ui/modifiers.go
Normal file
172
ui/modifiers.go
Normal file
@@ -0,0 +1,172 @@
|
||||
package ui
|
||||
|
||||
func (v View) SpaceEvenly() View {
|
||||
v.e.Get("style").Call("setProperty", "justify-content", "space-evenly")
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) SpaceBetween() View {
|
||||
v.e.Get("style").Call("setProperty", "justify-content", "space-between")
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) AlignCenter() View {
|
||||
v.e.Get("style").Call("setProperty", "align-items", "center")
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) AlignRight() View {
|
||||
v.e.Get("style").Call("setProperty", "align-items", "flex-end")
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) AlignLeft() View {
|
||||
v.e.Get("style").Call("setProperty", "align-items", "flex-start")
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) JustifyContent(justify string) View {
|
||||
v.e.Get("style").Call("setProperty", "justify-content", justify)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Margin(margin string) View {
|
||||
v.e.Get("style").Call("setProperty", "margin", margin)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Padding(padding string) View {
|
||||
v.e.Get("style").Call("setProperty", "padding", padding)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Font(font Font) View {
|
||||
v.e.Get("style").Call("setProperty", "font", font.String())
|
||||
v.e.Get("style").Call("setProperty", "line-height", font.lineheight)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Color(color string) View {
|
||||
v.e.Get("style").Call("setProperty", "color", color)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Gap(gap string) View {
|
||||
v.e.Get("style").Call("setProperty", "gap", gap)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Border(border string) View {
|
||||
v.e.Get("style").Call("setProperty", "border", border)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BorderTop(border string) View {
|
||||
v.e.Get("style").Call("setProperty", "border-top", border)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BorderBottom(border string) View {
|
||||
v.e.Get("style").Call("setProperty", "border-bottom", border)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BorderLeft(border string) View {
|
||||
v.e.Get("style").Call("setProperty", "border-left", border)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BorderRight(border string) View {
|
||||
v.e.Get("style").Call("setProperty", "border-right", border)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) TextAlign(align string) View {
|
||||
v.e.Get("style").Call("setProperty", "text-align", align)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) MaxWidth(width string) View {
|
||||
v.e.MaxWidth(width)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Width(width string) View {
|
||||
v.e.Width(width)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Height(height string) View {
|
||||
v.e.Height(height)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Background(color string) View {
|
||||
v.e.BackgroundColor(color)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Foreground(color string) View {
|
||||
v.e.Color(color)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) MinHeight(height string) View {
|
||||
v.e.MinHeight(height)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BoxShadow(shadow string) View {
|
||||
v.e.BoxShadow(shadow)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) BorderRadius(radius string) View {
|
||||
v.e.BorderRadius(radius)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Cursor(cursor string) View {
|
||||
v.e.Cursor(cursor)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Position(pos string) View {
|
||||
v.e.Position(pos)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Left(value string) View {
|
||||
v.e.Left(value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Top(value string) View {
|
||||
v.e.Top(value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Overflow(value string) View {
|
||||
v.e.Overflow(value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) Display(value string) View {
|
||||
v.e.Get("style").Call("setProperty", "display", value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) GridTemplateColumns(value string) View {
|
||||
v.e.Get("style").Call("setProperty", "grid-template-columns", value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) AlignItems(value string) View {
|
||||
v.e.Get("style").Call("setProperty", "align-items", value)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v View) PointerEvents(value string) View {
|
||||
v.e.PointerEvents(value)
|
||||
return v
|
||||
}
|
||||
Reference in New Issue
Block a user