Class: Primer::Forms::FormControl
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Primer::Forms::FormControl
- Defined in:
- app/lib/primer/forms/form_control.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(input:, tag: :div, **system_arguments) ⇒ FormControl
constructor
A new instance of FormControl.
Methods inherited from BaseComponent
compile!, #content, #input?, #perform_render, #render?, #to_component, #type
Methods included from ActsAsComponent
#compile!, extended, #renders_templates
Methods included from ClassNameHelper
Constructor Details
#initialize(input:, tag: :div, **system_arguments) ⇒ FormControl
Returns a new instance of FormControl.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/lib/primer/forms/form_control.rb', line 9 def initialize(input:, tag: :div, **system_arguments) @input = input @tag = tag @input.add_label_classes("FormControl-label") @form_group_arguments = { **system_arguments, class: class_names( system_arguments[:class], system_arguments[:classes], "FormControl", "width-full FormControl--fullWidth" => @input.full_width? ) } @form_group_arguments[:hidden] = "hidden" if @input.hidden? end |