Class: FoxTail::PopoverTriggerComponent::StimulusController
- Inherits:
-
StimulusController
- Object
- StimulusController
- FoxTail::PopoverTriggerComponent::StimulusController
- Defined in:
- app/components/fox_tail/popover_trigger_component.rb
Constant Summary collapse
- TRIGGER_TYPES =
{ hover: { hoverShow: %i[mouseenter focus], hoverHide: %i[mouseleave blur] }, click: { toggle: :click, hide: %i[focusout blur] } }.freeze
Instance Attribute Summary
Attributes inherited from StimulusController
Instance Method Summary collapse
Methods inherited from StimulusController
#action, #action_param_key, #build_actions, #classes_key, #config, #event, #initialize, #merge, #merge!, #outlet_key, #target_key, #to_s, #to_sym, #value_key
Constructor Details
This class inherits a constructor from FoxTail::StimulusController
Instance Method Details
#attributes(options = nil) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/components/fox_tail/popover_trigger_component.rb', line 31 def attributes( = nil) trigger_type = [:trigger_type]&.to_sym attributes = super attributes[:data][value_key(:delay)] = [:delay] attributes[:data][outlet_key(popover_identifier)] = [:selector] attributes[:data][:action] = build_actions TRIGGER_TYPES[trigger_type] attributes end |
#popover_identifier ⇒ Object
27 28 29 |
# File 'app/components/fox_tail/popover_trigger_component.rb', line 27 def popover_identifier FoxTail::PopoverComponent.stimulus_controller_identifier end |