Class: FoxTail::InputBaseComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::InputBaseComponent
- Includes:
- Concerns::Formable, Concerns::HasStimulusController, Concerns::Placeholderable
- Defined in:
- app/components/fox_tail/input_base_component.rb
Direct Known Subclasses
FileInputComponent, InputComponent, SelectComponent, TextareaComponent
Defined Under Namespace
Classes: StimulusController
Instance Attribute Summary
Attributes inherited from BaseComponent
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Class Method Details
.stimulus_controller_name ⇒ Object
49 50 51 |
# File 'app/components/fox_tail/input_base_component.rb', line 49 def stimulus_controller_name "form-field" end |
Instance Method Details
#before_render ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/components/fox_tail/input_base_component.rb', line 12 def before_render super add_default_name_and_id update_state_from_object! html_attributes[:placeholder] = retrieve_placeholder if placeholder? end |
#stimulus_controller_options ⇒ Object
24 25 26 |
# File 'app/components/fox_tail/input_base_component.rb', line 24 def {} end |
#use_stimulus? ⇒ Boolean
20 21 22 |
# File 'app/components/fox_tail/input_base_component.rb', line 20 def use_stimulus? super && controlled? end |