Sha256: 2afe72108584049c0f523d77e5449d59aa2914646e6b4af794e7c0a1c1c94d55

Contents?: true

Size: 705 Bytes

Versions: 30

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class FacetFieldFilterComponent < ::ViewComponent::Base
    def initialize(facet_field:)
      @facet_field = facet_field
    end

    def render?
      @facet_field.facet_field.index_range.any?
    end

    def prefix
      @facet_field.paginator.prefix
    end

    def clear_facet_prefix_url
      @facet_field.paginator.params_for_resort_url('index', @facet_field.search_state.to_h.except(@facet_field.paginator.request_keys[:prefix]))
    end

    def facet_prefix_url(letter)
      @facet_field.paginator.params_for_resort_url('index', @facet_field.search_state.to_h.merge(@facet_field.paginator.request_keys[:prefix] => letter))
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
blacklight-7.24.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.23.0.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.23.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.22.2 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.22.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.22.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.21.2 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.21.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.21.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.20.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.20.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.19.2 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.19.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.19.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.18.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.18.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.17.2 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.17.1 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.17.0 app/components/blacklight/facet_field_filter_component.rb
blacklight-7.16.0 app/components/blacklight/facet_field_filter_component.rb