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.10.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.9.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.9.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.9.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.8.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.8.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.7.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.7.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.6.3 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.6.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.5.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.5.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.4.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.3.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.3.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.2.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.1.9 lib/primer/forms/dsl/toggle_switch_input.rb