Class: Primer::Alpha::SelectPanel::ItemList
- Inherits:
-
ActionList
- Object
- ViewComponent::Base
- Component
- ActionList
- Primer::Alpha::SelectPanel::ItemList
- Includes:
- Utils
- Defined in:
- app/components/primer/alpha/select_panel.rb
Overview
The component that should be used to render the list of items in the body of a SelectPanel.
Constant Summary
Constants inherited from ActionList
ActionList::ARIA_SELECTION_VARIANT_OPTIONS, ActionList::DEFAULT_ARIA_SELECTION_VARIANT, ActionList::DEFAULT_MENU_ITEM_ROLE, ActionList::DEFAULT_ROLE, ActionList::DEFAULT_SCHEME, ActionList::DEFAULT_SELECT_VARIANT, ActionList::LIST_BOX_ITEM_ROLE, ActionList::MENU_ROLE, ActionList::SCHEME_MAPPINGS, ActionList::SCHEME_OPTIONS, ActionList::SELECT_VARIANT_OPTIONS, ActionList::SELECT_VARIANT_ROLE_MAP
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 Primer::AttributesHelper
Primer::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Primer::AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary
Attributes inherited from ActionList
#aria_selection_variant, #id, #role, #select_variant
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ ItemList
constructor
A new instance of ItemList.
- #with_avatar_item(**system_arguments) ⇒ Object
- #with_item(**system_arguments) ⇒ Object
Methods included from Utils
Methods inherited from ActionList
#acts_as_form_input?, #acts_as_listbox?, #acts_as_menu?, #allows_selection?, #before_render, #build_avatar_item, #build_item, #custom_element_name, custom_element_name, #multi_select?, #required_form_arguments_given?, #single_select?, #will_add_item, #with_divider
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 Primer::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) ⇒ ItemList
Returns a new instance of ItemList.
273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'app/components/primer/alpha/select_panel.rb', line 273 def initialize(**system_arguments) raise_if_role_given!(**system_arguments) select_variant = system_arguments.delete(:select_variant) || Primer::Alpha::ActionList::DEFAULT_SELECT_VARIANT super( p: 2, role: "listbox", aria_selection_variant: select_variant == :single ? :selected : :checked, select_variant: select_variant == :multiple ? :multiple_checkbox : :single, **system_arguments ) end |
Instance Method Details
#with_avatar_item(**system_arguments) ⇒ Object
291 292 293 294 |
# File 'app/components/primer/alpha/select_panel.rb', line 291 def with_avatar_item(**system_arguments) raise_if_role_given!(**system_arguments) super end |
#with_item(**system_arguments) ⇒ Object
286 287 288 289 |
# File 'app/components/primer/alpha/select_panel.rb', line 286 def with_item(**system_arguments) raise_if_role_given!(**system_arguments) super end |