Class: Blacklight::SearchNavbarComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::SearchNavbarComponent
show all
- Defined in:
- app/components/blacklight/search_navbar_component.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
Returns a new instance of SearchNavbarComponent.
5
6
7
|
# File 'app/components/blacklight/search_navbar_component.rb', line 5
def initialize(blacklight_config:)
@blacklight_config = blacklight_config
end
|
Instance Attribute Details
#blacklight_config ⇒ Object
Returns the value of attribute blacklight_config.
9
10
11
|
# File 'app/components/blacklight/search_navbar_component.rb', line 9
def blacklight_config
@blacklight_config
end
|
Instance Method Details
#search_bar ⇒ Object
13
14
15
|
# File 'app/components/blacklight/search_navbar_component.rb', line 13
def search_bar
render search_bar_component
end
|
#search_bar_component ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'app/components/blacklight/search_navbar_component.rb', line 17
def search_bar_component
search_bar_component_class.new(
url: helpers.search_action_url,
advanced_search_url: helpers.search_action_url(action: 'advanced_search'),
params: helpers.search_state.params_for_search.except(:qt),
autocomplete_path: suggest_index_catalog_path
)
end
|
#search_bar_component_class ⇒ Object
26
27
28
|
# File 'app/components/blacklight/search_navbar_component.rb', line 26
def search_bar_component_class
view_config&.search_bar_component || Blacklight::SearchBarComponent
end
|
#view_config ⇒ Object
30
31
32
|
# File 'app/components/blacklight/search_navbar_component.rb', line 30
def view_config
blacklight_config&.view_config(helpers.document_index_view_type)
end
|