<%= content_tag(:div, id: object.id, data: object.data, class: object.classname, **combined_html_options) do %> <%= object.wrapper do %> <%= pb_rails("flex", props: { orientation: "row", padding_right: "lg", vertical: "center" }) do %> <% if (object.template != "sort_only") %> <%= pb_rails("circle_icon_button", props: { variant: "secondary", icon: "filter", id:"filter#{object.id}"}) %>
<% if object.filters&.none? { |filter| filter[:name].present? } %>
<%= pb_rails("body", props: { color: "light", padding_left: "xs", size: 4, tag:"span", text: "No Filter Selected" }) %>
<% end %> <% object.filters&.each do |filter| %> <% if filter[:name].present? %>
<%= pb_rails("caption", props: { text: filter[:name]}) %> <%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
<% end %> <% end %>
<% if (object.template != "default") %> <%= pb_rails("caption", props: {text: object.result_text, size:"xs", classname:"filter-results"})%> <% end %> <% end %> <% if (object.template == "single" ) || (object.template == "sort_only") %> <% unless object.sort_menu == [{}] %> <%= pb_rails("button", props: {variant: "link",id: "sort-button#{object.id}",padding_right: "none"}) do %> <% object.sort_menu.each do |item| %> <% if item[:active] == true %> <%= item[:item] %> <%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]), fixed_width: true }) %> <% end %> <% end %> <% end %> <% end %> <% end %> <% end %> <% if (object.template == "default")%> <%= pb_rails("section_separator") %> <%= pb_rails("flex", props: {orientation: "row", vertical: "center", spacing: "between", classname: "filter-bottom"}) do %> <%= pb_rails("title_count", props: {title: "Results:",count: object.results, align:"center"}) %> <%= pb_rails("flex", props: {orientation: "row", vertical: "center"}) do %> <%= pb_rails("caption", props: { text: "sort by:"}) %> <%= pb_rails("button", props: {variant: "link", padding_right: "none", id: "sort-button#{object.id}"}) do %> <% object.sort_menu.each do |item| %> <% if item[:active] == true %> <%= item[:item] %> <%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]), fixed_width: true }) %> <% end %> <% end %> <% end %> <% end %> <% end %> <% end %> <% end %> <% if object.template != "sort_only"%> <%= pb_rails("popover", props: {max_height: object.max_height, min_width: object.min_width, close_on_click: "outside", trigger_element_id: "filter#{object.id}", tooltip_id: "filter-form#{object.id}", position: object.placement }.merge(object.popover_props)) do %> <%= content %> <% end %> <%end%> <% if object.template != "filter_only"%> <%= pb_rails("popover", props: {max_height: object.max_height, classname: "pb_filter_sort_menu", close_on_click: "outside", trigger_element_id: "sort-button#{object.id}", tooltip_id: "sort-filter-btn-tooltip#{object.id}", position: object.placement , padding: 'none'}.merge(object.popover_props)) do %> <%= pb_rails("list") do %> <% object.sort_menu.each do |item| %> <%= pb_rails("list/item") do%> <%= pb_rails("button", props: {variant: "link" ,classname: "p-0", text: item[:item], link: item[:link]}) %><% end %> <% end %> <% end %> <% end %> <% end %> <% end %>