Class: Yattho::Alpha::SegmentedControl::Item
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Component
- BaseComponent
- Yattho::Alpha::SegmentedControl::Item
- Defined in:
- app/components/yattho/alpha/segmented_control/item.rb
Overview
SegmentedControl::Item is a private component that is only used by SegmentedControl It wraps the Button and IconButton components to provide the correct styles
Constant Summary
Constants inherited from BaseComponent
BaseComponent::SELF_CLOSING_TAGS
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
Instance Method Summary collapse
-
#initialize(label:, selected: false, icon: nil, hide_labels: false, **system_arguments) ⇒ Item
constructor
A new instance of Item.
Methods inherited from BaseComponent
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
Constructor Details
#initialize(label:, selected: false, icon: nil, hide_labels: false, **system_arguments) ⇒ Item
Returns a new instance of Item.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/components/yattho/alpha/segmented_control/item.rb', line 15 def initialize(label:, selected: false, icon: nil, hide_labels: false, **system_arguments) @icon = icon @hide_labels = hide_labels @label = label @selected = selected @system_arguments = system_arguments @system_arguments[:'data-action'] = "click:segmented-control#select" if system_arguments[:href].nil? @system_arguments[:'aria-current'] = selected @system_arguments[:scheme] = :invisible end |