Class: Primer::Beta::AutoComplete::NoResultItem
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Primer::Beta::AutoComplete::NoResultItem
- Defined in:
- app/components/primer/beta/auto_complete/no_result_item.rb
Overview
Use ‘NoResultItem` to display a message when no autocomplete results are found. Renders as a simple div inside the overlay, not as a list item.
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ NoResultItem
constructor
A new instance of NoResultItem.
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Methods included from AttributesHelper
#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Methods included from ExperimentalSlotHelpers
Methods included from ExperimentalRenderHelpers
Constructor Details
#initialize(**system_arguments) ⇒ NoResultItem
Returns a new instance of NoResultItem.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/primer/beta/auto_complete/no_result_item.rb', line 12 def initialize(**system_arguments) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:"data-no-result-found"] = true @system_arguments[:"aria-hidden"] = true @system_arguments[:classes] = class_names( "p-2", "color-fg-muted", system_arguments[:classes] ) end |
Instance Method Details
#call ⇒ Object
25 26 27 |
# File 'app/components/primer/beta/auto_complete/no_result_item.rb', line 25 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |