Class: Polaris::PageComponent::ActionGroupComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Polaris::PageComponent::ActionGroupComponent
- Defined in:
- app/components/polaris/page_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
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title:, actions: []) ⇒ ActionGroupComponent
constructor
A new instance of ActionGroupComponent.
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(title:, actions: []) ⇒ ActionGroupComponent
Returns a new instance of ActionGroupComponent.
120 121 122 123 |
# File 'app/components/polaris/page_component.rb', line 120 def initialize(title:, actions: []) @title = title @actions = actions end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
118 119 120 |
# File 'app/components/polaris/page_component.rb', line 118 def actions @actions end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
117 118 119 |
# File 'app/components/polaris/page_component.rb', line 117 def title @title end |
Instance Method Details
#call ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'app/components/polaris/page_component.rb', line 125 def call render(Polaris::PopoverComponent.new( position: :below, scrollable_shadow: false )) do |popover| popover.(disclosure: true) { @title } polaris_action_list do |list| @actions.each do |action| list.with_item(**action) { action[:content] } end end end end |