Sha256: 7ed219ac802f273591d340760a1984d00ee13fabdd7f3e63ebd83c00ce9ab66f

Contents?: true

Size: 897 Bytes

Versions: 31

Compression:

Stored size: 897 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class SearchNavbarComponent < Blacklight::Component
    def initialize(blacklight_config:)
      @blacklight_config = blacklight_config
    end

    attr_reader :blacklight_config

    delegate :container_classes, to: :helpers

    def search_bar
      render search_bar_component
    end

    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

    def search_bar_component_class
      view_config&.search_bar_component || Blacklight::SearchBarComponent
    end

    def view_config
      blacklight_config&.view_config(helpers.document_index_view_type)
    end
  end
end

Version data entries

31 entries across 30 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/search_navbar_component.rb
blacklight-7.40.0 app/components/blacklight/search_navbar_component.rb
blacklight-8.6.0 app/components/blacklight/search_navbar_component.rb
blacklight-8.5.1 app/components/blacklight/search_navbar_component.rb
blacklight-8.5.0 app/components/blacklight/search_navbar_component.rb
blacklight-7.39.0 app/components/blacklight/search_navbar_component.rb
blacklight-8.4.0 app/components/blacklight/search_navbar_component.rb
blacklight-7.38.0 app/components/blacklight/search_navbar_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/search_navbar_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/search_navbar_component.rb
blacklight-8.3.0 app/components/blacklight/search_navbar_component.rb
blacklight-8.2.2 app/components/blacklight/search_navbar_component.rb
blacklight-8.2.1 app/components/blacklight/search_navbar_component.rb
blacklight-8.2.0 app/components/blacklight/search_navbar_component.rb
blacklight-7.37.0 app/components/blacklight/search_navbar_component.rb
blacklight-7.36.2 app/components/blacklight/search_navbar_component.rb
blacklight-7.36.1 app/components/blacklight/search_navbar_component.rb
blacklight-7.36.0 app/components/blacklight/search_navbar_component.rb
blacklight-7.35.0 app/components/blacklight/search_navbar_component.rb
blacklight-8.1.0 app/components/blacklight/search_navbar_component.rb