Class: Plutonium::UI::Table::Components::SelectionColumn

Inherits:
Phlexi::Table::Components::SelectionColumn
  • Object
show all
Defined in:
lib/plutonium/ui/table/components/selection_column.rb

Overview

Custom selection column with Stimulus data attributes for bulk actions

Direct Known Subclasses

Base::SelectionColumn

Instance Method Summary collapse

Instance Method Details

#data_cell(wrapped_object) ⇒ Object



13
14
15
16
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 13

def data_cell(wrapped_object)
  allowed_actions = compute_allowed_actions(wrapped_object.unwrapped)
  SelectionDataCell.new(wrapped_object.field(value_key).dom.value, allowed_actions)
end

#data_cell_attributes(wrapped_object) ⇒ Object



22
23
24
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 22

def data_cell_attributes(wrapped_object)
  {scope: :row}
end

#header_cellObject



9
10
11
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 9

def header_cell
  SelectionHeaderCell.new
end

#header_cell_attributesObject



18
19
20
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 18

def header_cell_attributes
  {class: "w-12"}
end