Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field type extensions #410

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

saleyn
Copy link

@saleyn saleyn commented Feb 26, 2025

This change enables to extend fields with custom types in order to be able to inject custom body in a field wrapper.

This change enables to extend fields with custom types
in order to be able to inject custom body in a field wrapper.
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Extension behavior with required render/1 and optional get_class_for_type/1 callbacks
  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant