Conversation
daf535e to
e600a4c
Compare
There was a problem hiding this comment.
PR Summary
This PR introduces a field extension behavior system that allows developers to create custom field types with their own rendering logic and CSS classes in the Petal Components library.
- Added new
PetalComponents.Field.Extensionbehavior with requiredrender/1and optionalget_class_for_type/1callbacks - Implemented persistent term storage for field extensions to optimize performance (6.96x faster than Application.get_env)
- Added support for merging custom assigns with field extensions for flexible customization
- Added comprehensive test coverage for extension fields with datalist support
- Introduced phx-debounce support for form validation with configurable delay
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
5 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
This change enables to extend fields with custom types in order to be able to inject custom body in a field wrapper.
|
Hi @saleyn. Could you create a standalone component to achieve the same thing or is there a benefit to using this method instead? |
|
It seems to me that restricting the inputs to a set of predefined types is too limiting as users often need to define custom input handlers. The disadvantage of needing to implement a standalone input component is in uniformity of field styling and naming (e.g. not being able to use |
This change enables to extend fields with custom types in order to be able to inject custom body in a field wrapper.