Class: Primer::Alpha::SelectPanel::ItemList

Inherits:
ActionList show all
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

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

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

Methods included from Utils

#raise_if_role_given!

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

deprecated?, generate_id

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from TestSelectorHelper

#add_test_selector

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Methods included from ClassNameHelper

#class_names

Methods included from Primer::AttributesHelper

#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes

Methods included from ExperimentalSlotHelpers

included

Methods included from ExperimentalRenderHelpers

included

Constructor Details

#initialize(**system_arguments) ⇒ ItemList

Returns a new instance of ItemList.

Parameters:

  • system_arguments (Hash)

    The arguments accepted by <%= link_to_component(Primer::Alpha::ActionList) %>.



273
274
275
276
277
278
279
280
281
282
283
# File 'app/components/primer/alpha/select_panel.rb', line 273

def initialize(**system_arguments)
  raise_if_role_given!(**system_arguments)
  select_variant = system_arguments[:select_variant] || Primer::Alpha::ActionList::DEFAULT_SELECT_VARIANT

  super(
    p: 2,
    role: "listbox",
    aria_selection_variant: select_variant == :single ? :selected : :checked,
    **system_arguments
  )
end

Instance Method Details

#with_avatar_item(**system_arguments) ⇒ Object



290
291
292
293
# File 'app/components/primer/alpha/select_panel.rb', line 290

def with_avatar_item(**system_arguments)
  raise_if_role_given!(**system_arguments)
  super
end

#with_item(**system_arguments) ⇒ Object



285
286
287
288
# File 'app/components/primer/alpha/select_panel.rb', line 285

def with_item(**system_arguments)
  raise_if_role_given!(**system_arguments)
  super
end