{% macro wrapper(field, v) %}
{% if v.show_label %}
{% if v.hint %} {{ v.hint }}{{ icon(v.hint_icon, 'h-4 w-4') }} {% endif %}
{% endif %} {{ caller() }} {% for error in v.errors %}

{{ __(error) }}

{% endfor %} {% if v.helper_text %}

{{ v.helper_text }}

{% endif %}
{% endmacro %} {# Disabled inputs are not submitted, so mirror their state to survive live re-renders. #} {% macro mirror(v) %} {% if v.disabled %} {% if v.state is iterable and v.state is not string %} {% for item in v.state %}{% endfor %} {% elif v.state is sameas true %} {% elif v.state is not sameas false and v.state is not none %} {% endif %} {% endif %} {% endmacro %} {% macro ring(v) -%} {{ 'ring-danger-600 dark:ring-danger-500' if v.errors else 'ring-gray-950/10 dark:ring-white/20' }} {%- endmacro %} {% macro ui_action(form, action, label, cls='', icon_name=None, title=None) %} {% set label = __(label) if label else label %} {% endmacro %}