feat(ui:filter): add quick clear button to filter button

This commit is contained in:
Herculino Trotta
2026-09-12 12:06:55 -03:00
parent 721b2dcd8d
commit 0ab2a41ccc
4 changed files with 34 additions and 21 deletions
@@ -103,11 +103,12 @@
{# Main control bar with filter, search, and ordering #}
<div class="join w-full">
<button class="btn btn-secondary join-item relative z-1" type="button"
@click="filterOpen = !filterOpen"
:aria-expanded="filterOpen" id="filter-button"
title="{% translate 'Filter transactions' %}"
_="on change from #filter-container
<div class="relative join-item z-10">
<button class="btn btn-secondary join-item relative z-1" type="button"
@click="filterOpen = !filterOpen"
:aria-expanded="filterOpen" id="filter-button"
title="{% translate 'Filter transactions' %}"
_="on change from #filter-container
-- Check if any filter has a non-default value
set hasActiveFilter to false
@@ -207,9 +208,10 @@
else
add .hidden to #filter-active-indicator
end">
<i class="fa-solid fa-filter fa-fw"></i>
<span id="filter-active-indicator" class="absolute -top-1 -right-1 w-3 h-3 bg-error rounded-full {% if not filter_is_active %}hidden {% endif %}z-10"></span>
</button>
<i class="fa-solid fa-filter fa-fw"></i>
</button>
{% include "transactions/fragments/filter_active_indicator.html" %}
</div>
{# Search box #}
<label for="quick-search" class="hidden">
@@ -277,7 +279,7 @@
{% include "transactions/fragments/filter_form.html" %}
<div class="text-right">
<a class="btn btn-outline btn-error btn-sm w-fit"
<a id="filter-clear" class="btn btn-outline btn-error btn-sm w-fit"
href="{{ request.path }}"
hx-get="{% url 'transaction_filter_clear' %}"
hx-target="#filter"