Sha256: bf7f98ca8fb9823038e436dc936039366b212d4621d2e724469f9af6bd7481da

Contents?: true

Size: 664 Bytes

Versions: 13

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  module Forms
    module Dsl
      # :nodoc:
      class ButtonInput < Input
        attr_reader :name, :label, :block

        def initialize(name:, label:, **options, &block)
          @name = name
          @label = label
          @caption = options.delete(:caption)
          @block = block

          super(**options)
        end

        def to_component
          Ariadne::UI::Button::Component.new.with_caption(@caption).with_block(@block)
        end

        # :nocov:
        def type
          :button
        end

        def supports_validation?
          false
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.79.2 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.79.1 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.79 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.78 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.77 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.76.1 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.76 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.75 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.74.1 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.74 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.73 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.72 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.71 lib/ariadne/forms/dsl/button_input.rb