Releases: wrabit/django-cotton
v1.5.2
Allow valid json to be passed inside attributes
Previously, passing a space inside a quoted string inside an attribute value would produce a malformed string due to the way Django understands attributes on a templatetag. Cotton's underlying component templatetag now handles this as expected.
In reference to:
Full Changelog: v1.5.1...v1.5.2
v1.5.1
v1.5.0
Support shorthand alpine.js x-bind
with ::
- Support colon escaping - alpinejs bind shortcut support by @wrabit in #227
- More here: https://django-cotton.com/docs/components#alpine-js-support
- Related discussion #180
Full Changelog: v1.4.0...v1.5.0
v1.4.0
Support for top-level project root templates
If you are a top-level templates person, you can now place your cotton components in the project root folder. Both of these approaches are supported:
[project]/templates/cotton/...
(NEW)[project]/[app]/templates/cotton/...
Full Changelog: v1.3.0...v1.4.0
v1.3.0
Support hyphenated filenames
This introduces a new config option as detailed in the docs: https://django-cotton.com/docs/configuration.
Summary
<c-my-button />
Filepath before: cotton/my_button.html
Filepath after: cotton/my-button.html
(with COTTON_SNAKE_CASED_NAMES = False
)
What else
Cotton only supports a maximum of 1 c-vars
tag per component. Some user's reach for using multiple, which is not currently supported. To ensure this is clear, cotton now raises an exception when it detects more than one c-vars
in a component.
Full Changelog: v1.2.1...v1.3.0