Class: Primer::Forms::Dsl::CheckBoxGroupInput
- Defined in:
- app/lib/primer/forms/dsl/check_box_group_input.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Input
Input::DEFAULT_INPUT_WIDTH, Input::DEFAULT_SIZE, Input::INPUT_WIDTH_MAPPINGS, Input::INPUT_WIDTH_OPTIONS, Input::SIZE_MAPPINGS, Input::SIZE_OPTIONS, Input::SPACE_DELIMITED_ARIA_ATTRIBUTES
Instance Attribute Summary collapse
-
#check_boxes ⇒ Object
readonly
Returns the value of attribute check_boxes.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Input
#base_id, #builder, #caption, #form, #form_control, #ids, #input_arguments, #label_arguments, #validation_message
Instance Method Summary collapse
- #autofocus! ⇒ Object
- #check_box(**system_arguments, &block) ⇒ Object
- #focusable? ⇒ Boolean
-
#initialize(name: nil, label: nil, **system_arguments) {|_self| ... } ⇒ CheckBoxGroupInput
constructor
A new instance of CheckBoxGroupInput.
- #to_component ⇒ Object
- #type ⇒ Object
Methods inherited from Input
#add_input_aria, #add_input_classes, #add_input_data, #add_label_classes, #caption?, #caption_id, #caption_template?, #disabled?, #full_width?, #hidden?, #id, #input?, #input_width, #invalid?, #merge_input_arguments!, #remove_input_data, #render_caption_template, #required?, #size, #supports_validation?, #valid?, #validation_arguments, #validation_error_icon_target, #validation_id, #validation_message_arguments, #validation_messages, #validation_success_icon_target, #value, #values_disambiguate_template_names?
Methods included from ClassNameHelper
Constructor Details
#initialize(name: nil, label: nil, **system_arguments) {|_self| ... } ⇒ CheckBoxGroupInput
Returns a new instance of CheckBoxGroupInput.
10 11 12 13 14 15 16 17 18 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 10 def initialize(name: nil, label: nil, **system_arguments) @name = name @label = label @check_boxes = [] super(**system_arguments) yield(self) if block_given? end |
Instance Attribute Details
#check_boxes ⇒ Object (readonly)
Returns the value of attribute check_boxes.
8 9 10 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 8 def check_boxes @check_boxes end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
8 9 10 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 8 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 8 def name @name end |
Instance Method Details
#autofocus! ⇒ Object
32 33 34 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 32 def autofocus! @check_boxes.first&.autofocus! end |
#check_box(**system_arguments, &block) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 36 def check_box(**system_arguments, &block) args = { name: @name, builder: @builder, form: @form, scheme: scheme, disabled: disabled?, **system_arguments } @check_boxes << CheckBoxInput.new(**args, &block) end |
#focusable? ⇒ Boolean
28 29 30 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 28 def focusable? true end |
#to_component ⇒ Object
20 21 22 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 20 def to_component CheckBoxGroup.new(input: self) end |
#type ⇒ Object
24 25 26 |
# File 'app/lib/primer/forms/dsl/check_box_group_input.rb', line 24 def type :check_box_group end |