Sha256: dcbf024667e6fe5858b2af266b06c56e9bbb267db9e243f801674e19d3d2d2e6

Contents?: true

Size: 741 Bytes

Versions: 9

Compression:

Stored size: 741 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
        helpers.paginate @response, **Blacklight::Engine.config.blacklight.default_pagination_options, **@pagination_args
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
blacklight-7.38.0 app/components/blacklight/response/pagination_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/response/pagination_component.rb
blacklight-7.37.0 app/components/blacklight/response/pagination_component.rb
blacklight-7.36.2 app/components/blacklight/response/pagination_component.rb
blacklight-7.36.1 app/components/blacklight/response/pagination_component.rb
blacklight-7.36.0 app/components/blacklight/response/pagination_component.rb
blacklight-7.35.0 app/components/blacklight/response/pagination_component.rb
blacklight-7.34.0 app/components/blacklight/response/pagination_component.rb
blacklight-8.0.1 app/components/blacklight/response/pagination_component.rb