Sha256: da1d76c17abd0d9346a85aeb84e1f9c3636716f790cde0dda9cdb0fe0937fd51

Contents?: true

Size: 830 Bytes

Versions: 13

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Response
    # Render a pagination widget for search results
    class PaginationComponent < Blacklight::Component
      # @param [Blacklight::Response] response
      # @param [Hash] html html options for the pagination container
      def initialize(response:, html: {}, **pagination_args)
        @response = response
        @html = html
        @pagination_args = pagination_args
      end

      def html_attr
        { aria: { label: t('views.pagination.aria.container_label') } }.merge(@html)
      end

      def pagination
        args = configured_options.merge(@pagination_args).compact
        helpers.paginate @response, **args
      end

      def configured_options
        controller.blacklight_config.index.pagination_options
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/response/pagination_component.rb
blacklight-7.40.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.6.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.5.1 app/components/blacklight/response/pagination_component.rb
blacklight-8.5.0 app/components/blacklight/response/pagination_component.rb
blacklight-7.39.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.4.0 app/components/blacklight/response/pagination_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/response/pagination_component.rb
blacklight-8.3.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.2.2 app/components/blacklight/response/pagination_component.rb
blacklight-8.2.1 app/components/blacklight/response/pagination_component.rb
blacklight-8.2.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.1.0 app/components/blacklight/response/pagination_component.rb