Internal issue 3055 - UI kit custom events signatures are inconsistent
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
h3. Summary
The signatures for custom events are inconsistent across component types.
h3. 💬 Description
The signatures of custom events vary between components.
For example, the select component implements icChange with a signature of IcMultiValueEventDetail, whilst the date picker component implements the same icChange event with a signature of { value: Date; }.
It would be most beneficial for the signatures of custom event types to be consistent across components as that way handlers can be registered in a much simpler way when utilising the web components, such as in Blazor. (See [https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-9.0#custom-event-arguments|https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-9.0#custom-event-arguments] for the Microsoft recommendation on registering custom event handlers in Blazor).
h3. 💰 Use value
This would allow for wrapping frameworks to generically implement the callback handling, rather than having to implement separate handlers for each component (both on the server side and client side (javascript).
h3. 📝 Acceptance Criteria
h3. ✏ Designs
h3. 🚨 Urgency (low, medium or high)
Low
h3. Additional info
I am currently working on a Blazor (C#) class library acting as a wrapper for ICDS, which will make it much easier to use ICDS in Blazor. Although this is a low priority, I think it would be most beneficial as it would allow me to implement the event callbacks, and make the library available to use for others (whilst also ourselves).
Contributor guide
Research direction
Start by inventorying the custom event declarations for the select and date picker components, focusing on their icChange details. The issue names no files, tests, or target signature, so clarify the consistent event shape and scope with maintainers before making changes. Done should mean component event handlers can be registered generically for the Blazor wrapper.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100