Sha256: dff2d7060b295c2d0fb7a72a9d1e9b4ae6bd2d207b20319ec75363d306d84414

Contents?: true

Size: 1.26 KB

Versions: 140

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    Select = Primer::FormComponents.from_input(Primer::Forms::Dsl::SelectInput)

    # Select lists are single-line text inputs rendered as `<select>` tags in HTML.
    #
    # @form_usage
    #   class ExampleForm < ApplicationForm
    #     form do |example_form|
    #       example_form.select_list(attributes) do |list|
    #         list.option(option_attributes)
    #       end
    #     end
    #   end
    class Select < Primer::Component
      status :alpha

      # @!method initialize
      #
      # @macro form_size_arguments
      # @macro form_input_arguments
      #
      # @param multiple [Boolean] If set to true, the selection will allow multiple choices.
      # @param include_blank [Boolean, String] If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty.
      # @param prompt [String] Create a prompt option with blank value and the text asking user to select something.

      # @!method option
      #
      # Adds an option to the list.
      #
      # @param label [String] The user-facing label for the option.
      # @param value [String] The value sent to the server on form submission.
    end
  end
end

Version data entries

140 entries across 140 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.52.2 app/components/primer/alpha/select.rb
primer_view_components-0.36.4 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.52.1 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.52.0 app/components/primer/alpha/select.rb
primer_view_components-0.36.3 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.51.0 app/components/primer/alpha/select.rb
primer_view_components-0.36.2 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.50.1 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.50.0 app/components/primer/alpha/select.rb
primer_view_components-0.36.1 app/components/primer/alpha/select.rb
primer_view_components-0.36.0 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.49.2 app/components/primer/alpha/select.rb
primer_view_components-0.35.2 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.49.1 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.49.0 app/components/primer/alpha/select.rb
primer_view_components-0.35.1 app/components/primer/alpha/select.rb
primer_view_components-0.35.0 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.48.2 app/components/primer/alpha/select.rb
openproject-primer_view_components-0.48.1 app/components/primer/alpha/select.rb