Class: Polaris::ButtonGroupComponent::ButtonGroupItemButtonComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Polaris::ButtonGroupComponent::ButtonGroupItemButtonComponent
- Defined in:
- app/components/polaris/button_group_component.rb
Constant Summary
Constants included from ViewHelper
ViewHelper::POLARIS_HELPERS, ViewHelper::POLARIS_TEXT_STYLES
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(position:, **system_arguments) ⇒ ButtonGroupItemButtonComponent
constructor
A new instance of ButtonGroupItemButtonComponent.
Methods included from ViewHelper
#polaris_body_styles, #polaris_html_classes, #polaris_html_styles, #polaris_icon_source
Methods included from StylesListHelper
Methods included from OptionHelper
#append_option, #prepend_option
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #fetch_or_fallback_nested
Methods included from ClassNameHelper
Constructor Details
#initialize(position:, **system_arguments) ⇒ ButtonGroupItemButtonComponent
Returns a new instance of ButtonGroupItemButtonComponent.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'app/components/polaris/button_group_component.rb', line 71 def initialize(position:, **system_arguments) @position = position @system_arguments = system_arguments @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( @system_arguments[:classes], "Polaris-ButtonGroup__Item", "Polaris-ButtonGroup__Item--plain": system_arguments.key?(:plain) ) end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
69 70 71 |
# File 'app/components/polaris/button_group_component.rb', line 69 def position @position end |
Instance Method Details
#call ⇒ Object
83 84 85 86 87 88 89 |
# File 'app/components/polaris/button_group_component.rb', line 83 def call = @system_arguments.except(:classes, :tag) render(Polaris::BaseComponent.new(tag: @system_arguments[:tag], classes: @system_arguments[:classes])) do render(Polaris::ButtonComponent.new(**)) { [:content] || content } end end |