Sha256: 7ceae78a6be54077edf01a32cb05575441bcb29ef271a9638d1aadd4c6dbc03b

Contents?: true

Size: 734 Bytes

Versions: 32

Compression:

Stored size: 734 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Forms
    class Builder
      class ActionArea
        def initialize(view_context, submit_default_value)
          self.view_context = view_context
          self.submit_default_value = submit_default_value
        end

        def submit(value = nil, props: {})
          props[:type] ||= "submit"
          props[:text] ||= value || submit_default_value

          button(value, props: props)
        end

        def button(value = nil, props:)
          view_context.content_tag(:li) do
            view_context.pb_rails("button", props: props)
          end
        end

      private

        attr_accessor :view_context, :submit_default_value
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
playbook_ui-9.3.0.alpha.inline3 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.0.pre.alpha.password.strength.2 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.0.alpha.inline2 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.0.alpha.inline1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.0.pre.alpha.password.strength.1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.2.2.pre.alpha.margin lib/playbook/forms/builder/action_area.rb
playbook_ui-9.2.2 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.2.1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.2.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.1.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.0.0 lib/playbook/forms/builder/action_area.rb