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
primer_view_components-0.22.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.21.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.25.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.24.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.21.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.20.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.20.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.23.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.19.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.22.2 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.18.2 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.22.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.18.1 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.22.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.18.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.21.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.17.0 lib/primer/forms/dsl/toggle_switch_input.rb
openproject-primer_view_components-0.20.0 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.16.1 lib/primer/forms/dsl/toggle_switch_input.rb
primer_view_components-0.16.0 lib/primer/forms/dsl/toggle_switch_input.rb