Class: Blacklight::Response::PaginationComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::PaginationComponent
show all
- Defined in:
- app/components/blacklight/response/pagination_component.rb
Overview
Render a pagination widget for search results
Constant Summary
Constants inherited
from Component
Component::EXCLUDE_VARIABLES
Instance Method Summary
collapse
Methods inherited from Component
compiler, config, #inspect
Constructor Details
#initialize(response:, html: {}, **pagination_args) ⇒ PaginationComponent
Returns a new instance of PaginationComponent.
9
10
11
12
13
|
# File 'app/components/blacklight/response/pagination_component.rb', line 9
def initialize(response:, html: {}, **)
@response = response
@html = html
@pagination_args =
end
|
Instance Method Details
24
25
26
|
# File 'app/components/blacklight/response/pagination_component.rb', line 24
def configured_options
controller.blacklight_config.index.
end
|
#html_attr ⇒ Object
15
16
17
|
# File 'app/components/blacklight/response/pagination_component.rb', line 15
def html_attr
{ aria: { label: t('views.pagination.aria.container_label') } }.merge(@html)
end
|
19
20
21
22
|
# File 'app/components/blacklight/response/pagination_component.rb', line 19
def
args = configured_options.merge(@pagination_args).compact
helpers.paginate @response, **args
end
|