calico icon indicating copy to clipboard operation
calico copied to clipboard

Feature request: typed inputs

Open kubukoz opened this issue 1 year ago • 5 comments

It would be amazing to have typed events for inputs. This is the tweet.

like, maybe type := "file" can carry a singleton type of "file" and this can somehow be used to derive a more specific type in onChange, like in typescript?

kubukoz avatar Sep 28 '24 23:09 kubukoz

Hey @kubukoz!

Here’s what I’m thinking:

Type Mapping: Create a mapping system that associates input types with their respective TypeScript types, allowing for seamless type inference in onChange events.

Documentation Enhancements: I could also add examples in the documentation to demonstrate how to utilize this feature effectively, making it easier for developers to adopt.

Let me know if you’d like to discuss this further or if there are any specific requirements you have in mind!

faresbouzayen avatar Sep 28 '24 23:09 faresbouzayen

100% a bot response.

kubukoz avatar Sep 29 '24 00:09 kubukoz

Haha, I can see why it feels like a bot response! But honestly, what specific input types do you think we should focus on first?

faresbouzayen avatar Sep 29 '24 00:09 faresbouzayen

I think getting this to work with the generic syntax type := "file" may be more challenging ... but maybe we could add a custom builder to the DSL e.g. input["file"](...). I think we'd also need something like the changes I suggested https://github.com/armanbilge/calico/issues/180, where attributes and events can be typed specifically according to the element type. This will help us better support Web Components.

armanbilge avatar Sep 29 '24 09:09 armanbilge

Hi there,

Looks interesting issue,

I will be addressing this issue.

Could you assign me to resolve this issue.

Thank You.

SanjayUG avatar Mar 22 '25 14:03 SanjayUG