Sha256: ac37332c5fdff932431ca818a9f83036d0cde98e820a06df2df12b7e5302e1a7

Contents?: true

Size: 697 Bytes

Versions: 117

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Forms
    module Dsl
      # :nodoc:
      class ToggleSwitchInput < Input
        attr_reader :name, :label, :src, :csrf

        def initialize(
          name:,
          label:,
          src:,
          csrf: nil,
          **system_arguments
        )
          @name = name
          @label = label
          @src = src
          @csrf = csrf

          super(**system_arguments)
        end

        def to_component
          ToggleSwitch.new(input: self)
        end

        def type
          :toggle_switch
        end

        def validation_arguments
          super.merge(role: "alert")
        end
      end
    end
  end
end

Version data entries

117 entries across 117 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.49.2 app/lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.35.2 app/lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.49.1 app/lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.49.0 app/lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.35.1 app/lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.35.0 app/lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.48.2 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.48.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.48.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.47.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.47.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.34.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.46.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.46.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.45.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.44.3 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.44.2 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.44.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.33.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.44.0 lib/primer/forms/dsl/toggle_switch_input.rb