Class: Blacklight::Response::FacetGroupComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::FacetGroupComponent
- Defined in:
- app/components/blacklight/response/facet_group_component.rb
Overview
Render a group of facet fields
Instance Attribute Summary collapse
-
#body_classes ⇒ Object
Returns the value of attribute body_classes.
Instance Method Summary collapse
- #button_component ⇒ Object
- #collapse_toggle_button(panel_id) ⇒ Object
-
#initialize(id:, title: nil, body_classes: 'facets-collapse d-lg-block collapse accordion') ⇒ FacetGroupComponent
constructor
A new instance of FacetGroupComponent.
- #render? ⇒ Boolean
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
#initialize(id:, title: nil, body_classes: 'facets-collapse d-lg-block collapse accordion') ⇒ FacetGroupComponent
Returns a new instance of FacetGroupComponent.
11 12 13 14 15 16 17 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 11 def initialize(id:, title: nil, body_classes: 'facets-collapse d-lg-block collapse accordion') @groupname = id @id = id ? "facets-#{id}" : 'facets' @title = title || I18n.t("blacklight.search.#{@id}.title") @panel_id = id ? "facet-panel-#{id}-collapse" : 'facet-panel-collapse' @body_classes = body_classes end |
Instance Attribute Details
#body_classes ⇒ Object
Returns the value of attribute body_classes.
19 20 21 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 19 def body_classes @body_classes end |
Instance Method Details
#button_component ⇒ Object
25 26 27 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 25 def Blacklight::Response::FacetToggleButtonComponent end |
#collapse_toggle_button(panel_id) ⇒ Object
21 22 23 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 21 def (panel_id) render .new(panel_id: panel_id) end |
#render? ⇒ Boolean
29 30 31 32 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 29 def render? # debugger body.present? end |