//go:build js && wasm package ultraviolet import ( "syscall/js" ) type ContainerComponentWeb struct { node js.Value view View value Value handler ClickHandler } func NewContainerComponentWeb(view View) *ContainerComponentWeb { return &ContainerComponentWeb{ view: view, } } // Component func (this *ContainerComponentWeb) Build(parent Component) { this.node = WebBuildDiv( this.node, parent, this.view, "", "", AbstractHandlers{ HANDLER_CLICK: func(args ...any) error { if this.handler == nil { return nil } this.handler() return nil }, }, ) } func (this *ContainerComponentWeb) Invalidate() bool { if this.value == nil { return false } return this.value.Invalidate() } func (this *ContainerComponentWeb) Clean() { WebCleanChildren(this.node) } // JS func (this *ContainerComponentWeb) Node() js.Value { return this.node } // ComponentContainer func (this *ContainerComponentWeb) SetValue(value Value) { this.value = value } func (this *ContainerComponentWeb) SetHandler(handler ClickHandler) { this.handler = handler }