Sha256: 2dec1cb26d62eff677295129cfe5c301b9c58bbd1023005eba9f49be6fb61c53

Contents?: true

Size: 630 Bytes

Versions: 7

Compression:

Stored size: 630 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:, **system_arguments, &block)
          @name = name
          @label = label
          @block = block

          super(**system_arguments)
        end

        def to_component
          Ariadne::UI::Button::Component.new(label: @label).with_content(@label)
        end

        # :nocov:
        def type
          :button
        end

        def supports_validation?
          false
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.70 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.69 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.68 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.67 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.66 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.65 lib/ariadne/forms/dsl/button_input.rb
ariadne_view_components-0.0.64 lib/ariadne/forms/dsl/button_input.rb