Extend existing componants in coconut

Hi

I am porting a project from Vue to coconut, and I am trying to make it with the minimum changes, in the past I managed already to do this ```class TextBox extends coconut.ui.View {

@:controlled var model:String;
function render() {
    return hxx('<input type="text" value={model} oninput={e->model=e.src.value} />');
}

}```
Which worked fine to emulate v-model behavior, I later changed the attribute name to vmodel, I would like to allow the hyphen too v-model but whatever.

I am haveing now an issue, I want to allow textbox to use all attributes availible to input such as style class and whaever, and pass them over to the input, I tried to extend the html input class, aswell as to call input as a function (like we could in tink_hxx), but was unable to get it working.
I wouldn’t make send to fill up the page with all my blind attempts, I will post to to explain where I was heading, in general I would like to hear more on how the hxx magic is working.

    @controlled public var vmodel:String="";
    function render() {
        return textarea({value:vmodel.toString(),oninput:e->vmodel=e.src.value},[]);
    }
}


function vtextarea2(attributes:tink.domspec.Tags, children:Array<RenderResult>):View {
    return hxx('<textarea {...attributes}>{...children}</textarea>');
}

Thank you

Well while not being completel clear I did some research on it, and I would like to update my progress.

Parctical

  1. The folllowing is a valid render function
import coconut.vdom.Html;
//...
function render(){
		return Html.div({},{className: "abc"},[]);
}
  1. The above can be wrapped within a function that could modify the call parameters

Technical

  1. Coconut is relying on tink_hxx, in coconut.vdom.macros.HXX the generator is being generated with all fields in its uncle coconut.vdom.Html
  2. These Html.whatever fields are being generated with a build macro, by looping over the list of tags availible within tink.domspec.Tags.

Remaining chalanges,

  1. Observe how the props and controlled are working.
  2. how we can make use of a own hxx function that would respect our own types.

Lets hope that one of the cocogeeks will enlight us.