Components

Latest version: v0.0.1a0

Safety actively analyzes 682674 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.92

What's Changed

🚨 Breaking changes 🚨
- `Component` class is no longer a subclass of `View`. To configure the `View` class, set the `Component.View` nested class. HTTP methods like `get` or `post` can still be defined directly on `Component` class, and `Component.as_view()` internally calls `Component.View.as_view()`. (See [Modifying the View class](https://github.com/EmilStenstrom/django-components#modifying-the-view-class))

Feat
- The inputs (args, kwargs, slots, context, ...) that you pass to `Component.render()` can be accessed from within `get_context_data`, `get_template_string` and `get_template_name` via `self.input`. (See [Accessing data passed to the component](https://github.com/EmilStenstrom/django-components#accessing-data-passed-to-the-component))

- Typing: `Component` class supports generics that specify types for `Component.render` (See [Adding type hints with Generics](https://github.com/EmilStenstrom/django-components#adding-type-hints-with-generics))


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.91...0.92

0.91

What's Changed
Fix
* Allow `None` for attrs and defaults in `html_attrs` tag by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/591


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.90...0.91

0.90

What's Changed
Feat
- All tags (`component`, `slot`, `fill`, ...) now support "self-closing" or "inline" form, where you can omit the closing tag:
django
{ Before }
{% component "button" %}{% endcomponent %}
{ After }
{% component "button" / %}

- All tags now support the "dictionary key" or "aggregate" syntax (`kwarg:key=val`):
django
{% component "button" attrs:class="hidden" %}

- You can change how the components are written in the template with [TagFormatter](customizing-component-tags-with-tagformatter).

The default is `django_components.component_formatter`:
django
{% component "button" href="..." disabled %}
Click me!
{% endcomponent %}


While `django_components.shorthand_component_formatter` allows you to write components like so:

django
{% button href="..." disabled %}
Click me!
{% endbutton %}


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.89...0.90

0.89

What's Changed
* Fix the case when there is an `{% include %}` tag inside a component's template and the component is rendered with `render/render_to_response`, with the `context` kwarg specified. See https://github.com/EmilStenstrom/django-components/pull/582


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.88...0.89

0.88

What's Changed

Refactor
* `ComponentRegistry()` accepts an optional `library` kwarg (https://github.com/EmilStenstrom/django-components/pull/566)
* `register` decorator accepts an optional `registry` kwarg (https://github.com/EmilStenstrom/django-components/pull/566)

Docs
* Document how `ComponentRegistry` works (https://github.com/EmilStenstrom/django-components/pull/566)

**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.87...0.88

0.87

What's Changed

Refactor

* refactor: Prepare package exports for v1 by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/562


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.86...0.87

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.