<%%= search_form_for [:<%=options[:namespace].underscore %>, @q], method: :post, class: "", data: { controller: "search-form", search_form_target: "form", turbo_frame: '<%=class_name.underscore.pluralize%>' } do |f| %>
<%- bo_model.columns.group_by(&:type).each do |type| -%>
<%- type.second.sort_by(&:type).each do |col| -%>
<%- next if excluded_columns.include?(col.name.to_sym) || bo_model.reflect_on_all_associations.map(&:foreign_key).include?(col.name) -%>
<%- next if bo_model.reflect_on_all_associations.map(&:foreign_key).include?(col.name) -%>
<%- if col.type == :string || col.type == :text -%>
<%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
<%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
<%% end %>
<%- elsif col.type ==:integer -%>
<%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
<%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
<%% end %>
<%- elsif col.type == :boolean -%>
<%%= f.hidden_field :<%= col.name %>_eq, value: nil, data: { action: "change->search-form#search"}%>
<%- elsif col.type == :datetime || col.type == :date -%>
<%%= render(Forms::SearchDateInputComponent.new(
label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'),
form: f,
field: '<%= col.name %>')
) %>
<%- end -%>
<%- end -%>
<%- end -%>
<%- belongs_to_assoc.each do |association| -%>
<%%= f.select :<%= association.foreign_key %>_eq, <%=association.klass.name.constantize%>.all.map { |value| [value.<%=bo_model_title(association.class_name.constantize)%>, value.id] }, { include_blank: true }, { class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:text-sm", data: { action: "input->search-form#search" } } %>
<%- end -%>
<%% end %>