Class: Primer::OpenProject::SubHeader::QuickActionComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Primer::OpenProject::SubHeader::QuickActionComponent
- Defined in:
- app/components/primer/open_project/sub_header/quick_action_component.rb
Overview
Thin wrapper for quick filter slots that defers BaseComponent construction to render time, allowing system arguments (e.g. display) to be mutated in before_render. Do not use standalone
Constant Summary
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 AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ QuickActionComponent
constructor
A new instance of QuickActionComponent.
- #merge_system_arguments!(**other_arguments) ⇒ Object
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 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) ⇒ QuickActionComponent
Returns a new instance of QuickActionComponent.
11 12 13 14 15 16 17 18 19 |
# File 'app/components/primer/open_project/sub_header/quick_action_component.rb', line 11 def initialize(**system_arguments) @system_arguments = system_arguments system_arguments[:tag] = :div system_arguments[:mr] ||= 2 system_arguments[:classes] = class_names( "SubHeader-hiddenOnExpand", system_arguments[:classes] ) end |
Instance Method Details
#call ⇒ Object
27 28 29 |
# File 'app/components/primer/open_project/sub_header/quick_action_component.rb', line 27 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |
#merge_system_arguments!(**other_arguments) ⇒ Object
21 22 23 24 25 |
# File 'app/components/primer/open_project/sub_header/quick_action_component.rb', line 21 def merge_system_arguments!(**other_arguments) @system_arguments[:aria] = merge_aria(@system_arguments, other_arguments) @system_arguments[:data] = merge_data(@system_arguments, other_arguments) @system_arguments.merge!(**other_arguments) end |