2024-09-17 10:38:02 -04:00
|
|
|
<%# locals: (form:) %>
|
|
|
|
|
2024-05-30 20:55:18 -04:00
|
|
|
<div
|
|
|
|
id="transaction-filters-menu"
|
|
|
|
data-menu-target="content"
|
|
|
|
data-controller="tabs"
|
2025-02-13 11:31:07 -05:00
|
|
|
data-tabs-active-class="bg-gray-25 text-primary"
|
2024-05-30 20:55:18 -04:00
|
|
|
data-tabs-default-tab-value="<%= get_default_transaction_search_filter[:key] %>"
|
2025-04-18 18:53:10 +05:30
|
|
|
class="hidden absolute flex flex-col md:flex-row z-10 h-auto md:h-80 w-full md:w-[540px] top-12 right-0 shadow-border-xs bg-container rounded-lg overflow-hidden">
|
|
|
|
<div class="flex w-full md:w-44 flex-row md:flex-col items-start p-3 text-sm font-medium text-secondary border-b md:border-b-0 md:border-r border-alpha-black-100 overflow-x-auto md:overflow-x-visible">
|
2024-05-30 20:55:18 -04:00
|
|
|
<% transaction_search_filters.each do |filter| %>
|
|
|
|
<button
|
2025-04-18 18:53:10 +05:30
|
|
|
class="flex text-secondary hover:bg-container-inset items-center gap-2 px-3 rounded-md py-2 min-w-max md:w-full"
|
2024-05-30 20:55:18 -04:00
|
|
|
type="button"
|
|
|
|
data-id="<%= filter[:key] %>"
|
|
|
|
data-tabs-target="btn"
|
|
|
|
data-action="tabs#select">
|
|
|
|
<%= lucide_icon(filter[:icon], class: "w-5 h-5") %>
|
2024-09-17 10:38:02 -04:00
|
|
|
<span class="text-sm font-medium"><%= t(".#{filter[:key]}") %></span>
|
2024-05-30 20:55:18 -04:00
|
|
|
</button>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex flex-col grow">
|
2025-04-18 18:53:10 +05:30
|
|
|
<div class="grow p-3 border-b border-b-alpha-black-100 overflow-y-auto max-h-[50vh] md:max-h-none">
|
2024-05-30 20:55:18 -04:00
|
|
|
<% transaction_search_filters.each do |filter| %>
|
|
|
|
<div id="<%= filter[:key] %>" data-tabs-target="tab">
|
|
|
|
<%= render partial: get_transaction_search_filter_partial_path(filter), locals: { form: form } %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2024-09-17 10:38:02 -04:00
|
|
|
|
2025-04-11 09:28:00 -05:00
|
|
|
<div class="flex justify-between items-center gap-2 bg-container p-3">
|
2024-09-17 10:38:02 -04:00
|
|
|
<div>
|
|
|
|
<% if @q.present? %>
|
2025-01-30 14:12:01 -05:00
|
|
|
<%= link_to t(".clear_filters"), transactions_path(clear_filters: true), class: "btn btn--ghost" %>
|
2024-09-17 10:38:02 -04:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2025-04-11 09:28:00 -05:00
|
|
|
<%= button_tag type: "reset", data: { action: "menu#close" }, class: "py-2 px-3 bg-container-inset rounded-lg text-sm text-primary font-medium" do %>
|
2024-09-17 10:38:02 -04:00
|
|
|
<%= t(".cancel") %>
|
|
|
|
<% end %>
|
2025-04-11 09:28:00 -05:00
|
|
|
<%= form.submit t(".apply"), name: nil, class: "py-2 px-3 bg-primary hover:bg-primary-dark rounded-lg text-sm text-white font-medium cursor-pointer" %>
|
2024-09-17 10:38:02 -04:00
|
|
|
</div>
|
2024-05-30 20:55:18 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|