Class: Blacklight::Facets::FiltersComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Facets::FiltersComponent
- Defined in:
- app/components/blacklight/facets/filters_component.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#index_navigation_component ⇒ Object
readonly
Returns the value of attribute index_navigation_component.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
-
#suggestions_component ⇒ Object
readonly
Returns the value of attribute suggestions_component.
Instance Method Summary collapse
- #facet ⇒ Object
- #index_navigation ⇒ Object
-
#initialize(presenter:, classes: 'facet-filters mt-1 mb-3', suggestions_component: Blacklight::Facets::SuggestComponent, index_navigation_component: Blacklight::Facets::IndexNavigationComponent) ⇒ FiltersComponent
constructor
A new instance of FiltersComponent.
- #render? ⇒ Boolean
- #render_index_navigation? ⇒ Boolean
- #suggestions ⇒ Object
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
#initialize(presenter:, classes: 'facet-filters mt-1 mb-3', suggestions_component: Blacklight::Facets::SuggestComponent, index_navigation_component: Blacklight::Facets::IndexNavigationComponent) ⇒ FiltersComponent
6 7 8 9 10 11 12 13 |
# File 'app/components/blacklight/facets/filters_component.rb', line 6 def initialize(presenter:, classes: 'facet-filters mt-1 mb-3', suggestions_component: Blacklight::Facets::SuggestComponent, index_navigation_component: Blacklight::Facets::) @presenter = presenter @classes = classes @suggestions_component = suggestions_component = end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
19 20 21 |
# File 'app/components/blacklight/facets/filters_component.rb', line 19 def classes @classes end |
#index_navigation_component ⇒ Object (readonly)
Returns the value of attribute index_navigation_component.
19 20 21 |
# File 'app/components/blacklight/facets/filters_component.rb', line 19 def end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
19 20 21 |
# File 'app/components/blacklight/facets/filters_component.rb', line 19 def presenter @presenter end |
#suggestions_component ⇒ Object (readonly)
Returns the value of attribute suggestions_component.
19 20 21 |
# File 'app/components/blacklight/facets/filters_component.rb', line 19 def suggestions_component @suggestions_component end |
Instance Method Details
#facet ⇒ Object
15 16 17 |
# File 'app/components/blacklight/facets/filters_component.rb', line 15 def facet @presenter.facet_field end |
#index_navigation ⇒ Object
35 36 37 |
# File 'app/components/blacklight/facets/filters_component.rb', line 35 def render .new(presenter: presenter) end |
#render? ⇒ Boolean
23 24 25 |
# File 'app/components/blacklight/facets/filters_component.rb', line 23 def render? presenter.suggest? || end |
#render_index_navigation? ⇒ Boolean
27 28 29 |
# File 'app/components/blacklight/facets/filters_component.rb', line 27 def facet.index_range && display_facet.index? end |
#suggestions ⇒ Object
31 32 33 |
# File 'app/components/blacklight/facets/filters_component.rb', line 31 def suggestions render suggestions_component.new(presenter: presenter) end |