Sha256: b7684123bb076f4e9fc8447bb69c705bc4602d79701ac73cf7052312336424d1

Contents?: true

Size: 1.75 KB

Versions: 6

Compression:

Stored size: 1.75 KB

Contents

<%# hover:z-[21] removed from tr class to solve flickering actions component on row controls and z-20 changed to z-21%>
<%= content_tag :tr,
  class: "bg-white hover:bg-gray-50 hover:shadow-row z-21 border-b",
  data: {
    component_name: self.class.to_s.underscore,
    resource_name: @resource.class.to_s,
    record_id: @resource.record.id,
    **item_selector_data_attributes(@resource),
    **(try(:drag_reorder_item_data_attributes) || {}),
  } do %>
  <% if @resource.record_selector %>
    <td class="w-10">
      <div class="flex justify-center h-full">
        <%= render Avo::RowSelectorComponent.new floating: false %>
      </div>
    </td>
  <% end %>
  <% if Avo.configuration.resource_controls_on_the_left? %>
    <td class="text-right whitespace-nowrap w-px" data-control="resource-controls">
      <div class="flex items-center justify-end flex-grow-0 h-full">
        <%= render resource_controls_component %>
      </div>
    </td>
  <% end %>
  <% @header_fields.each_with_index do |table_header_lable, index| %>
    <% field = @fields.find { |field| field.table_header_label == table_header_lable } %>
    <% if field.present? %>
      <%= render field.component_for_view(:index).new(
        field: field,
        resource: @resource,
        reflection: @reflection,
        index: index,
        parent_record: @parent_record,
        parent_resource: @parent_resource
      ) %>
    <% else %>
      <td class="text-center">—</td>
    <% end %>
  <% end %>
  <% if Avo.configuration.resource_controls_on_the_right? %>
    <td class="text-right whitespace-nowrap" data-control="resource-controls">
      <div class="flex items-center justify-end flex-grow-0 h-full">
        <%= render resource_controls_component %>
      </div>
    </td>
  <% end %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
avo-3.9.2 app/components/avo/index/table_row_component.html.erb
avo-3.9.1 app/components/avo/index/table_row_component.html.erb
avo-3.8.2 app/components/avo/index/table_row_component.html.erb
avo-3.9.0 app/components/avo/index/table_row_component.html.erb
avo-3.8.1 app/components/avo/index/table_row_component.html.erb
avo-3.8.0 app/components/avo/index/table_row_component.html.erb