compose

package
v0.0.0-...-6902453 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SubmitEventProviderContext = contextutil.New[SubmitEventProvider](
	contextutil.Defaulter(func() SubmitEventProvider {
		return &formController{}
	}),
)
View Source
var TextStyleContext = contextutil.New[text.Style](contextutil.Defaulter(func() text.Style {
	return text.Style{
		FontFamily: "",
		FontSize:   unit.Sp(16),
		LineHeight: unit.Sp(18),
		Color:      color.NRGBA{A: 0xff},
		TextAlign:  ptr.Ptr(text.Start),
	}
}))

Functions

func Echo

func Echo[O any](fn func() O) O

func Echo2

func Echo2[O any, O1 any](fn func() (O, O1)) (O, O1)

func Echo3

func Echo3[O any, O1 any, O2 any](fn func() (O, O1, O2)) (O, O1, O2)

func UseEffect

func UseEffect(ctx BuildContext, setup func() func(), deps []any)

func UseMemo

func UseMemo[T any](ctx BuildContext, setup func() T, deps []any) T

Types

type BuildContext

type BuildContext = internal.BuildContext

type Component

type Component = internal.Component

type ComponentWrapper

type ComponentWrapper = internal.ComponentWrapper

type Element

type Element = internal.Element

func Graph

func Graph(layout func(gtx layout.Context) layout.Dimensions) Element

type ElementPainter

type ElementPainter = internal.ElementPainter

func ElementPainterFunc

func ElementPainterFunc(layout func(gtx layout.Context) layout.Dimensions) ElementPainter

type IconvgSetter

type IconvgSetter interface {
	SetIconvg(src []byte)
}

type ImageSetter

type ImageSetter interface {
	SetImage(img image.Image)
}

type ParentInsetSetter

type ParentInsetSetter interface {
	SetParentInset(x unit.Dp, y unit.Dp)
}

type Ref

type Ref[T any] struct {
	Current T
}

func UseRef

func UseRef[T any](ctx BuildContext, initialValue T) *Ref[T]

type State

type State[T comparable] interface {
	Value() T
	Update(value T)
	UpdateFunc(func(prev T) T)
}

func UseState

func UseState[T comparable](ctx BuildContext, defaultState T) State[T]

type SubmitEventProvider

type SubmitEventProvider interface {
	WatchSubmitEvent(fn func())
	TriggerSubmit()
}

type TextSetter

type TextSetter interface {
	SetText(txt string)
}

type VNode

type VNode = internal.VNode

func Box

func Box(modifiers ...modifier.Modifier[any]) VNode

func CloneNode

func CloneNode(n VNode, modifiers ...modifier.Modifier[any]) VNode

func Column

func Column(modifiers ...modifier.Modifier[any]) VNode

func FormController

func FormController(modifiers ...modifier.Modifier[any]) VNode

func Fragment

func Fragment(vnodes ...VNode) VNode

Fragment children without Element wrapper

func H

func H(component Component, modifiers ...modifier.Modifier[any]) VNode

H Create VNode from Component

func Icon

func Icon(src []byte, modifiers ...modifier.Modifier[any]) VNode

Icon only support iconvg golang.org/x/exp/shiny/iconvg

func Image

func Image(image image.Image, modifiers ...modifier.Modifier[any]) VNode

func Input

func Input(modifies ...modifier.Modifier[any]) VNode

func Portal

func Portal(mountPoint node.Node) VNode

func ProvideTextStyle

func ProvideTextStyle(modifiers ...modifier.Modifier[*text.Style]) VNode

func Provider

func Provider(c func(ctx context.Context) context.Context, modifiers ...modifier.Modifier[any]) VNode

Provider inject something into context for child nodes

func Row

func Row(modifiers ...modifier.Modifier[any]) VNode

func Text

func Text(text string, modifies ...modifier.Modifier[*text.Style]) VNode

type WidgetWithPositionBy

type WidgetWithPositionBy interface {
	Element
	PositionBy(calc func() (x unit.Dp, y unit.Dp))
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL