Sha256: fa8acf9b0341c323fdb4111156172753de75e78870451ab7ed9f2732eb26ec85

Contents?: true

Size: 623 Bytes

Versions: 9

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Forms
    # :nodoc:
    class SelectList < BaseComponent
      delegate :builder, :form, to: :@input

      def initialize(input:)
        @input = input
        @input.add_input_classes(
          "FormControl-select",
          "FormControl--medium"
        )

        @field_wrap_arguments = {
          class: "FormControl-select-wrap",
          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

9 entries across 9 versions & 1 rubygems

Version Path
primer_view_components-0.0.121 lib/primer/forms/select_list.rb
primer_view_components-0.0.120 lib/primer/forms/select_list.rb
primer_view_components-0.0.119 lib/primer/forms/select_list.rb
primer_view_components-0.0.118 lib/primer/forms/select_list.rb
primer_view_components-0.0.117 lib/primer/forms/select_list.rb
primer_view_components-0.0.116 lib/primer/forms/select_list.rb
primer_view_components-0.0.115 lib/primer/forms/select_list.rb
primer_view_components-0.0.114 lib/primer/forms/select_list.rb
primer_view_components-0.0.113 lib/primer/forms/select_list.rb