Class: Ariadne::UI::ClipboardCopy::Component
- Inherits:
-
Button::Component
- Object
- ViewComponentContrib::Base
- BaseComponent
- Button::Component
- Ariadne::UI::ClipboardCopy::Component
- Defined in:
- app/components/ariadne/ui/clipboard_copy/component.rb
Overview
Use ‘ClipboardCopy` to copy element text content or input values to the clipboard.
Constant Summary
Constants inherited from BaseComponent
BaseComponent::ACCEPT_ANYTHING
Constants included from ViewHelper
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary
Attributes inherited from Button::Component
Instance Method Summary collapse
- #before_render ⇒ Object
- #classes ⇒ Object
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
Methods inherited from Button::Component
Methods included from Behaviors::Tooltipable
Methods included from Behaviors::Captionable
Methods inherited from BaseComponent
#class_for, #component, component_id, #component_id, component_name, #html_attributes, i18n_scope, #in_turbo_frame, #in_turbo_stream, #options, stimulus_name, #styles, translate, #validate_aria_label!
Methods included from ViewHelper
Methods included from AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes, #prepend_action, #prepend_controller, #prepend_data_attribute
Methods included from ViewComponent::StyleVariants
Constructor Details
#initialize(**options) ⇒ Component
Returns a new instance of Component.
29 30 31 32 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 29 def initialize(**) super validate! end |
Instance Method Details
#before_render ⇒ Object
48 49 50 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 48 def before_render validate_aria_label!(html_attrs) if content.blank? end |
#classes ⇒ Object
57 58 59 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 57 def classes style(:button, size:) + style(:size) end |