Sha256: 755a5eca150ff8be2bc1ce3266f945f2ad3469dbd8bba0eb60b3d785ccaaf5a1

Contents?: true

Size: 685 Bytes

Versions: 16

Compression:

Stored size: 685 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 @facet_field.facet_field.item_presenter.new(item, @facet_field.facet_field, helpers, @facet_field.key, @facet_field.search_state)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.3.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.2.2 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.2.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.2.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.1.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta8 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta7 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta6 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta5 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta4 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta3 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta2 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-8.0.0.beta1 app/components/blacklight/facet_field_checkboxes_component.rb