Class: Arara::DataTableBodyCheckboxComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::DataTableBodyCheckboxComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/data_table_body_checkbox_component.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
Instance Method Summary collapse
- #checkbox_class ⇒ Object
- #default_html_class ⇒ Object
- #html_options ⇒ Object
-
#initialize(selected: false, id:, **kw) ⇒ DataTableBodyCheckboxComponent
constructor
A new instance of DataTableBodyCheckboxComponent.
Methods included from BaseComponent
#default_data_controller, #default_html_tag, #html_class, #html_content, #html_data, #html_tag, included
Constructor Details
#initialize(selected: false, id:, **kw) ⇒ DataTableBodyCheckboxComponent
Returns a new instance of DataTableBodyCheckboxComponent.
6 7 8 9 10 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 6 def initialize(selected: false, id:, **kw) super(tag: "td", **kw) @selected = selected @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 4 def id @id end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
4 5 6 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 4 def selected @selected end |
Instance Method Details
#checkbox_class ⇒ Object
20 21 22 23 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 20 def checkbox_class return "mdc-checkbox mdc-data-table__row-checkbox mdc-checkbox--selected" if selected "mdc-checkbox mdc-data-table__row-checkbox" end |
#default_html_class ⇒ Object
12 13 14 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 12 def default_html_class "mdc-data-table__cell mdc-data-table__cell--checkbox" end |
#html_options ⇒ Object
16 17 18 |
# File 'app/components/arara/data_table_body_checkbox_component.rb', line 16 def super.merge!({role: "columnheader", scope: "col"}) end |