Sha256: 4d28edb520f42053e3ad0b5d501c9b52205c7e3c0dceb11c67f47b3e89b95ba6
Contents?: true
Size: 934 Bytes
Versions: 47
Compression:
Stored size: 934 Bytes
Contents
# frozen_string_literal: true module Primer module Forms # :nodoc: class Select < BaseComponent delegate :builder, :form, to: :@input def initialize(input:) @input = input @input.add_input_classes("FormControl-select") if !input.multiple? @input.add_input_classes( Primer::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size] ) end wrap_classes = ["FormControl-select-wrap"] wrap_classes << Primer::Forms::Dsl::Input::INPUT_WIDTH_MAPPINGS[@input.input_width] if @input.input_width @field_wrap_arguments = { class: class_names(wrap_classes), hidden: @input.hidden?, data: { multiple: input.multiple? } } end def options @options ||= @input.options.map do |option| [option.label, option.value, option.system_arguments] end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems