Class: Plutonium::UI::Table::Components::SelectionColumn
- Inherits:
-
Phlexi::Table::Components::SelectionColumn
- Object
- Phlexi::Table::Components::SelectionColumn
- Plutonium::UI::Table::Components::SelectionColumn
- Defined in:
- lib/plutonium/ui/table/components/selection_column.rb
Overview
Custom selection column with Stimulus data attributes for bulk actions
Direct Known Subclasses
Instance Method Summary collapse
- #data_cell(wrapped_object) ⇒ Object
-
#data_cell_attributes(wrapped_object) ⇒ Object
Add hidden class and Stimulus target to data cell.
- #header_cell ⇒ Object
-
#header_cell_attributes ⇒ Object
Add hidden class and Stimulus target to header cell.
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
Add hidden class and Stimulus target to data cell
27 28 29 30 31 32 33 |
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 27 def data_cell_attributes(wrapped_object) { scope: :row, class: "hidden", data: {bulk_actions_target: "selectionCell"} } end |
#header_cell ⇒ Object
9 10 11 |
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 9 def header_cell SelectionHeaderCell.new end |
#header_cell_attributes ⇒ Object
Add hidden class and Stimulus target to header cell
19 20 21 22 23 24 |
# File 'lib/plutonium/ui/table/components/selection_column.rb', line 19 def header_cell_attributes { class: "hidden w-12", data: {bulk_actions_target: "selectionCell"} } end |