Class: Ariadne::UI::ClipboardCopy::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponentContrib::Base
- BaseComponent
- Ariadne::UI::ClipboardCopy::Component
- Includes:
- Behaviors::Tooltipable
- Defined in:
- app/components/ariadne/ui/clipboard_copy/component.rb
Overview
Use this to copy element text content or input values to the clipboard.
Constant Summary collapse
- DEFAULT_SIZE =
:md
Constants inherited from BaseComponent
BaseComponent::ACCEPT_ANYTHING
Constants included from ViewHelper
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- #before_render ⇒ Object
- #classes ⇒ Object
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
Methods included from Behaviors::Tooltipable
Methods inherited from BaseComponent
audited_at, #class_for, #component, component_id, #component_id, component_name, generate_id, #html_attributes, i18n_scope, #merge_data_attributes, #merge_tailwind_classes, #options, stimulus_name, translate, #validate_aria_label!
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.
25 26 27 28 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 25 def initialize(**) super validate! end |
Instance Method Details
#before_render ⇒ Object
44 45 46 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 44 def before_render validate_aria_label!(html_attrs) if content.blank? end |
#classes ⇒ Object
53 54 55 |
# File 'app/components/ariadne/ui/clipboard_copy/component.rb', line 53 def classes style(:button, size:) + style(:size) end |