Sha256: 9db44aa7d21da1fb28613e4cf55e6c27a01aa02c007813b5c25f997aa828d77e

Contents?: true

Size: 717 Bytes

Versions: 20

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class FacetFieldInclusiveConstraintComponent < ::ViewComponent::Base
    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, @view_context, @facet_field.key, @facet_field.search_state)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
blacklight-7.22.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.22.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.22.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.21.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.21.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.21.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.20.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.20.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.19.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.19.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.19.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.18.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.18.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.17.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.17.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.17.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.16.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.15.2 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.15.1 app/components/blacklight/facet_field_inclusive_constraint_component.rb
blacklight-7.15.0 app/components/blacklight/facet_field_inclusive_constraint_component.rb