Sha256: 70732e20b50c483b53fa5a7d35a5e751826e50df1eb4382aabd7da0f40b60abc
Contents?: true
Size: 817 Bytes
Versions: 12
Compression:
Stored size: 817 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", Primer::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size] ) 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? } end def options @options ||= @input.options.map do |option| [option.label, option.value, option.system_arguments] end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems