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.10.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.10.0.pre.date.time.stacked.1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.9.0.alpha.inline1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.9.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.8.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.7.0.pre.alphawidth1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.7.0.pre.alpha.a11y.btn lib/playbook/forms/builder/action_area.rb
playbook_ui-9.7.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.6.1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.6.1.pre.deps1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.6.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.5.0.alpha.rs.downgrade lib/playbook/forms/builder/action_area.rb
playbook_ui-9.5.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.4.0.alpha.sisense lib/playbook/forms/builder/action_area.rb
playbook_ui-9.4.0.alpha.user.kit.bug lib/playbook/forms/builder/action_area.rb
playbook_ui-9.4.0 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.1.pre.alpha2 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.4.0.pre.alpha2 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.4.0.pre.alpha1 lib/playbook/forms/builder/action_area.rb
playbook_ui-9.3.1.pre.alpha1 lib/playbook/forms/builder/action_area.rb