Fixing bigs in macros

This commit is contained in:
Ronan Berder
2025-06-08 12:32:52 +08:00
parent e2dcbcb4dd
commit cdc52a810e
8 changed files with 289 additions and 18 deletions
+1 -1
View File
@@ -75,7 +75,7 @@
{% endfor %}
>
<h2 id="{{ id }}-title">{{ title | safe }}</h2>
<p>{{ description | safe }}</p>
{% if description %}<p>{{ description | safe }}</p>{% endif %}
</header>
{% endif %}
{% if caller %}
+3 -3
View File
@@ -21,7 +21,7 @@
x-data="dropdownMenu"
@click.away="open = false"
{% if id %}id="{{ id }}"{% endif %}
{% for key, value in main_attrs %}
{% for key, value in main_attrs.items() %}
{% if key != "class" %}{{ key }}="{{ value }}"{% endif %}
{% endfor %}
>
@@ -35,7 +35,7 @@
id="{{ id }}-trigger"
aria-controls="{{ id }}-menu"
{% endif %}
{% for key, value in trigger_attrs %}
{% for key, value in trigger_attrs.items() %}
{{ key }}="{{ value }}"
{% endfor %}
>
@@ -47,7 +47,7 @@
aria-hidden="true"
x-bind="$content"
{% if id %}id="{{ id }}-menu"{% endif %}
{% for key, value in content_attrs %}
{% for key, value in content_attrs.items() %}
{{ key }}="{{ value }}"
{% endfor %}
>
+1
View File
@@ -4,6 +4,7 @@
@param id {string} [optional] - Unique identifier for the select component.
@param selected {string} [optional] - The initially selected value.
@param name {string} [optional] - The name attribute for the hidden input storing the selected value.
@param items {array} [optional] - An array of items (objects with type, label, value, attrs, and items) to render.
@param main_attrs {object} [optional] - Additional HTML attributes for the main container div.
@param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button.
@param content_attrs {object} [optional] - Additional HTML attributes for the popover content div.
+2 -2
View File
@@ -10,7 +10,7 @@
{% macro toaster(
id="toaster",
toasts=[],
main_attrs=None,
main_attrs={},
is_fragment=False
) %}
<div
@@ -21,7 +21,7 @@
{% endfor %}
{% if is_fragment %}hx-swap-oob="beforeend"{% endif %}
>
{% for item in toasts.items() %}
{% for item in toasts %}
{{ toast(
category=item.category,
title=item.title,