Sha256: fd9042205440740df44f002bce53831e9c1f878a372c3cf358f9d768e2b6bbf3

Contents?: true

Size: 721 Bytes

Versions: 25

Compression:

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

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
blacklight-7.40.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.39.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.38.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.37.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.36.2 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.36.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.36.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.35.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.34.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.33.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.33.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.32.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.31.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.30.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.29.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.28.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.27.1 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.27.0 app/components/blacklight/facet_field_checkboxes_component.rb
blacklight-7.26.1 app/components/blacklight/facet_field_checkboxes_component.rb