Sha256: e409c3a8d81ac94aa7bd4b16a82100aa7980c681b04c53971cfffb5d492c9fdd

Contents?: true

Size: 478 Bytes

Versions: 3

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

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

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

    def sort_facet_url(sort)
      @facet_field.paginator.params_for_resort_url(sort, @facet_fieldsearch_state.to_h)
    end

    def param_name
      @facet_field.paginator.class.request_keys[:page]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-7.13.0 app/components/blacklight/facet_field_pagination_component.rb
blacklight-7.12.1 app/components/blacklight/facet_field_pagination_component.rb
blacklight-7.12.0 app/components/blacklight/facet_field_pagination_component.rb