Sha256: 23b6c9078d5bab116d09eabdddf5c086f79589bf813eef985320141dfad917fe

Contents?: true

Size: 711 Bytes

Versions: 46

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class FacetFieldInclusiveConstraintComponent < Blacklight::Component
    with_collection_parameter :facet_field

    def initialize(facet_field:, values: nil)
      @facet_field = facet_field
      @values = values
    end

    def values
      @values ||= @facet_field.values.find { |v| v.is_a? Array }
      @values || []
    end

    def render?
      values.present?
    end

    def presenters
      return to_enum(:presenters) unless block_given?

      values.each do |item|
        yield Blacklight::FacetGroupedItemPresenter.new(values, item, @facet_field.facet_field, helpers, @facet_field.key, @facet_field.search_state)
      end
    end
  end
end

Version data entries

46 entries across 45 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.40.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.6.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.5.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.5.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.39.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.4.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.38.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.3.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.2.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.2.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.2.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.37.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.36.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.36.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.36.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.35.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-8.1.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb