extend_class/3
behavior has been updated and will soon no longer replace default css classes based on their prefix (this behavior is still working but deprecated). To switch to the new behavior and suppress warning messages, pass theprefix_replace: false
option and use the new!
based syntax to explicitly remove default CSS classes. (ex:!border-* border-red-500
)
- another fix on
validate_required_attributes
not handling wellfalse
values
- @seb3s fixed a bug, that make
validate_required_attributes
not raising with some undefined attributes.
- fixed a nasty bug where
extend_class/3
was not updating assigns__changed__
key
🎉 phx_component_helpers
is stable for months and complete feature-wise.
It's ready for 1.0.0 :) 🔥
- removed interpolation of
raw
attributes as HEEX is now the only templating engine target byphx_component_helpers
- removed support of
phx_*
attributes in favor ofphx-*
attributes
- fixed an issue of duplicate attributes when combining
set_phx_attributes
withset_attributes
- using
Phoenix LiveView.assign/2
instead ofMap.put/3
. Big thanks to @thenrio!
- now injecting heex_attributes into assigns that can be used from heex templates
- switched examples to
HEEX
templating - new
PhxComponentHelpers.has_errors?/1
function validate_required_attributes/2
now raises a more comprehensive exception
PhxComponentHelpers.forward_assigns/2
with prefix :icon will now forward all:icon_*
keys and:icon
as well- removed
error_class
option onPhxComponentHelpers.extend_class/2
which can now be handled by using a function as the first parameter - merged first PR (mainly english mistakes ... 🇫🇷) ;-)
- new
:merge
option onPhxComponentHelpers.forward_assigns/2
PhxComponentHelpers.extend_class/2
can now take defaults as a function
- renamed
PhxComponentHelpers.set_component_attributes/3
intoPhxComponentHelpers.set_attributes/3
- removed
PhxComponentHelpers.set_data_attributes/3
which has been replaced by adata: true
option passed toPhxComponentHelpers.set_attributes/3
- new
PhxComponentHelpers.forward_assigns/2
to pass assigns to child components
- fixed default attributes behavior
:into
option ofPhxComponentHelpers.extend_class/2
is renamed in:attribute
PhxComponentHelpers.extend_class/2
will overwrite input assign class with extended classPhxComponentHelpers.set_form_attributes/1
will now set default form attributes when keys exist but are nilPhxComponentHelpers.set_attributes/3
and PhxComponentHelpers.set_data_attributes/3 can now take default values
PhxComponentHelpers.set_form_attributes/1
will now init form data with nil values when no form/field is providedPhxComponentHelpers.set_form_attributes/1
retrieves and assigns form errorsPhxComponentHelpers.extend_class/2
now supports new:error_class
option to extend CSS classes when a form field is faulty
- added
PhxViewHelpers
than can be used within templates - added
PhxComponentHelpers.set_form_attributes/1
to fetchPhoenix.HTML.Form
data
- all assigns are no longer prefixed by
html_
but byraw_
- new
:into
option is set_phx_attributes/2
has a default:into
optionextend_class/2
changes its signature to also useinto
set_attributes/3
will set absent assigns by default- removed
:init
option fromset_attributes/3
- added
validate_required_attributes/2
- New
set_prefixed_attributes/3
function that can be used to map alpinejs attributes
- Fixed issue when
Jason
library is not available - Removed hardcoded list of
phx_*
attributes
Initial release :)