Sha256: 1618221ad12b10c25404189d1f9e21abb89b2332042cfde21ae45907ce1e26e2

Contents?: true

Size: 684 Bytes

Versions: 6

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class FacetFieldCheckboxesComponent < Blacklight::Component
    def initialize(facet_field:, layout: nil)
      @facet_field = facet_field
      @layout = layout == false ? FacetFieldNoLayoutComponent : Blacklight::FacetFieldComponent
    end

    def render?
      presenters.any?
    end

    def presenters
      return [] unless @facet_field.paginator

      return to_enum(:presenters) unless block_given?

      @facet_field.paginator.items.each do |item|
        yield Blacklight::FacetCheckboxItemPresenter.new(item, @facet_field.facet_field, helpers, @facet_field.key, @facet_field.search_state)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-8.7.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.6.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.6.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.5.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.5.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.4.0 app/components/blacklight/facet_field_checkboxes_component.rb