Class: Blacklight::AdvancedSearchFormComponent
- Inherits:
 - 
      SearchBarComponent
      
        
- Object
 - ViewComponent::Base
 - Component
 - SearchBarComponent
 - Blacklight::AdvancedSearchFormComponent
 
 
- Defined in:
 - app/components/blacklight/advanced_search_form_component.rb
 
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
- #before_render ⇒ Object
 - #default_operator_menu ⇒ Object
 - 
  
    
      #hidden_search_state_params  ⇒ ActiveSupport::HashWithIndifferentAccess 
    
    
  
  
  
  
  
  
  
  
  
    
Filtered params to pass to hidden search fields.
 - 
  
    
      #initialize(response:, **options)  ⇒ AdvancedSearchFormComponent 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of AdvancedSearchFormComponent.
 - #sort_fields_select ⇒ Object
 
Methods inherited from SearchBarComponent
#advanced_search_enabled?, #autocomplete_path, #autofocus
Methods inherited from Component
Constructor Details
#initialize(response:, **options) ⇒ AdvancedSearchFormComponent
Returns a new instance of AdvancedSearchFormComponent.
      14 15 16 17  | 
    
      # File 'app/components/blacklight/advanced_search_form_component.rb', line 14 def initialize(response:, **) super(**) @response = response end  | 
  
Instance Method Details
#before_render ⇒ Object
      19 20 21 22 23  | 
    
      # File 'app/components/blacklight/advanced_search_form_component.rb', line 19 def before_render initialize_search_field_controls if search_field_controls.blank? initialize_search_filter_controls if search_filter_controls.blank? initialize_constraints if constraints.blank? end  | 
  
#default_operator_menu ⇒ Object
      25 26 27 28  | 
    
      # File 'app/components/blacklight/advanced_search_form_component.rb', line 25 def = [:must, :should].index_by { |op| t(op, scope: 'blacklight.advanced_search.op') } label_tag(:op, t('blacklight.advanced_search.op.label'), class: 'sr-only visually-hidden') + select_tag(:op, (, params[:op]), class: 'input-small') end  | 
  
#hidden_search_state_params ⇒ ActiveSupport::HashWithIndifferentAccess
Filtered params to pass to hidden search fields
      39 40 41  | 
    
      # File 'app/components/blacklight/advanced_search_form_component.rb', line 39 def hidden_search_state_params @params.except(:clause, :f_inclusive, :op, :sort) end  | 
  
#sort_fields_select ⇒ Object
      30 31 32 33 34 35  | 
    
      # File 'app/components/blacklight/advanced_search_form_component.rb', line 30 def sort_fields_select = sort_fields.values.map { |field_config| [helpers.sort_field_label(field_config.key), field_config.key] } return unless .any? select_tag(:sort, (, params[:sort]), class: "form-select custom-select sort-select w-auto", aria: { labelledby: 'advanced-search-sort-label' }) end  |