Sha256: aeedcbabdac80927bbdc267be56558565aafa54f2ab63b2270e17ad38735d2b5
Contents?: true
Size: 1.01 KB
Versions: 9
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Primer module Forms module Dsl # :nodoc: class CheckBoxGroupInput < Input attr_reader :label, :check_boxes def initialize(name: nil, label: nil, **system_arguments) @name = name @label = label @check_boxes = [] super(**system_arguments) add_label_classes("FormControl-label", "mb-2") yield(self) if block_given? end def to_component CheckBoxGroup.new(input: self) end def name nil end def type :check_box_group end def check_box(**system_arguments) args = { name: @name, **system_arguments, builder: @builder, form: @form, scheme: scheme } @check_boxes << CheckBoxInput.new(**args) end private def scheme @name ? :array : :boolean end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems