Sha256: 29031a6c649ce17cea02960339f2b19a2a4edf3f00c6a9587daf8d21129dc4d3

Contents?: true

Size: 740 Bytes

Versions: 22

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbForm
    module FormBuilder
      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

22 entries across 22 versions & 1 rubygems

Version Path
playbook_ui-8.3.0.alpha.select.pre.margin app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.3.0 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.1 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.1.3 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.4.0.alpha.dependencies.2 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.4.0.alpha.dependencies.1 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.0.pre.alpha4 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.0.pre.alpha3 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.2.0 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.1.2 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.1.0.pre.alpha1 app/pb_kits/playbook/pb_form/form_builder/action_area.rb
playbook_ui-8.0.3 app/pb_kits/playbook/pb_form/form_builder/action_area.rb