Class: Plutonium::UI::Table::Components::DragHandle::Cell

Inherits:
Phlexi::Table::HTML
  • Object
show all
Defined in:
lib/plutonium/ui/table/components/drag_handle.rb

Overview

A first-column cell with a grip in front of it.

The table renders whatever the column's own block returned; this wraps that component rather than replacing it, so a formatter, a custom block or an inferred display component all keep rendering exactly as they did. Flex rather than inline flow because that inner component may be block or inline depending on the field type, and the grip must sit beside it either way.

Nested inside DragHandle so referencing it loads this file — a sibling top-level class in drag_handle.rb would be invisible to Zeitwerk until something happened to touch DragHandle first.

Instance Method Summary collapse

Constructor Details

#initialize(cell, sort_url: nil) ⇒ Cell

Returns a new instance of Cell.



104
105
106
107
# File 'lib/plutonium/ui/table/components/drag_handle.rb', line 104

def initialize(cell, sort_url: nil)
  @cell = cell
  @sort_url = sort_url
end

Instance Method Details

#view_templateObject



109
110
111
112
113
114
# File 'lib/plutonium/ui/table/components/drag_handle.rb', line 109

def view_template
  div(class: themed(:drag_handle_cell)) do
    render DragHandle.new(sort_url: @sort_url)
    div(class: "min-w-0") { render @cell }
  end
end