Class: Spotlight::BulkActionComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Spotlight::BulkActionComponent
- Defined in:
- app/components/spotlight/bulk_action_component.rb
Overview
Displays the “Bulk actions” button and dropdown
Instance Attribute Summary collapse
-
#bulk_actions ⇒ Object
readonly
Returns the value of attribute bulk_actions.
-
#button_classes ⇒ Object
readonly
Returns the value of attribute button_classes.
Instance Method Summary collapse
- #button ⇒ Object
-
#initialize(bulk_actions:, button_classes: 'btn btn-secondary dropdown-toggle') ⇒ BulkActionComponent
constructor
A new instance of BulkActionComponent.
Constructor Details
#initialize(bulk_actions:, button_classes: 'btn btn-secondary dropdown-toggle') ⇒ BulkActionComponent
Returns a new instance of BulkActionComponent.
6 7 8 9 10 |
# File 'app/components/spotlight/bulk_action_component.rb', line 6 def initialize(bulk_actions:, button_classes: 'btn btn-secondary dropdown-toggle') @bulk_actions = bulk_actions @button_classes = super end |
Instance Attribute Details
#bulk_actions ⇒ Object (readonly)
Returns the value of attribute bulk_actions.
12 13 14 |
# File 'app/components/spotlight/bulk_action_component.rb', line 12 def bulk_actions @bulk_actions end |
#button_classes ⇒ Object (readonly)
Returns the value of attribute button_classes.
12 13 14 |
# File 'app/components/spotlight/bulk_action_component.rb', line 12 def @button_classes end |
Instance Method Details
#button ⇒ Object
14 15 16 17 18 |
# File 'app/components/spotlight/bulk_action_component.rb', line 14 def t(:'spotlight.bulk_actions.label'), id: 'bulk-actions-button', class: , data: { toggle: 'dropdown', 'bs-toggle': 'dropdown' }, aria: { haspopup: true, expanded: false } end |