Class: Blacklight::Facets::IndexNavigationComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Facets::IndexNavigationComponent
show all
- Defined in:
- app/components/blacklight/facets/index_navigation_component.rb
Instance Method Summary
collapse
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
Returns a new instance of IndexNavigationComponent.
7
8
9
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 7
def initialize(presenter:)
@presenter = presenter
end
|
Instance Method Details
#clear_facet_prefix_url ⇒ Object
23
24
25
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 23
def clear_facet_prefix_url
@presenter.paginator.params_for_resort_url('index', @presenter.search_state.to_h.except(@presenter.paginator.request_keys[:prefix]))
end
|
#facet_prefix_url(letter) ⇒ Object
27
28
29
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 27
def facet_prefix_url(letter)
@presenter.paginator.params_for_resort_url('index', @presenter.search_state.to_h.merge(@presenter.paginator.request_keys[:prefix] => letter))
end
|
#index_range ⇒ Object
15
16
17
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 15
def index_range
@presenter.facet_field.index_range
end
|
#prefix ⇒ Object
19
20
21
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 19
def prefix
@presenter.paginator.prefix
end
|
#render? ⇒ Boolean
11
12
13
|
# File 'app/components/blacklight/facets/index_navigation_component.rb', line 11
def render?
index_range && @presenter.display_facet.index?
end
|