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