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 Method Summary collapse
- #button_component ⇒ Object
- #collapse_toggle_button(panel_id) ⇒ Object
-
#initialize(id:, title: nil) ⇒ 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) ⇒ FacetGroupComponent
Returns a new instance of FacetGroupComponent.
11 12 13 14 15 16 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 11 def initialize(id:, title: nil) @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' end |
Instance Method Details
#button_component ⇒ Object
22 23 24 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 22 def Blacklight::Response::FacetToggleButtonComponent end |
#collapse_toggle_button(panel_id) ⇒ Object
18 19 20 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 18 def (panel_id) render .new(panel_id: panel_id) end |
#render? ⇒ Boolean
26 27 28 |
# File 'app/components/blacklight/response/facet_group_component.rb', line 26 def render? body.present? end |