Sha256: 2dd103970e390efa834169d8c34db5213684fa6849836fb02919be4ca93689fe

Contents?: true

Size: 1.3 KB

Versions: 333

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module Playbook
  module Forms
    class Builder < ::ActionView::Helpers::FormBuilder
      require_relative "builder/action_area"
      require_relative "builder/checkbox_field"
      require_relative "builder/collection_select_field"
      require_relative "builder/date_picker_field"
      require_relative "builder/form_field_builder"
      require_relative "builder/select_field"
      require_relative "builder/typeahead_field"

      prepend(FormFieldBuilder.new(:email_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:number_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:search_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:telephone_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:text_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:password_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:url_field, kit_name: "text_input"))
      prepend(FormFieldBuilder.new(:text_area, kit_name: "textarea"))

      def actions
        context = @template.respond_to?(:view_context) ? @template.view_context : @template
        context.content_tag :ol, class: "pb-form-actions" do
          yield ActionArea.new(@template, submit_default_value)
        end
      end
    end
  end
end

Version data entries

333 entries across 333 versions & 1 rubygems

Version Path
playbook_ui-9.10.0.pre.date.time.stacked.1 lib/playbook/forms/builder.rb
playbook_ui-9.10.0.pre.alpha2 lib/playbook/forms/builder.rb
playbook_ui-9.10.0.pre.alpha1 lib/playbook/forms/builder.rb
playbook_ui-9.9.0.alpha.inline1 lib/playbook/forms/builder.rb
playbook_ui-9.9.0 lib/playbook/forms/builder.rb
playbook_ui-9.8.0 lib/playbook/forms/builder.rb
playbook_ui-9.7.0.pre.alphawidth1 lib/playbook/forms/builder.rb
playbook_ui-9.7.0.pre.alpha.a11y.btn lib/playbook/forms/builder.rb
playbook_ui-9.7.0 lib/playbook/forms/builder.rb
playbook_ui-9.6.1 lib/playbook/forms/builder.rb
playbook_ui-9.6.1.pre.deps1 lib/playbook/forms/builder.rb
playbook_ui-9.6.0 lib/playbook/forms/builder.rb
playbook_ui-9.5.0.alpha.rs.downgrade lib/playbook/forms/builder.rb
playbook_ui-9.5.0 lib/playbook/forms/builder.rb
playbook_ui-9.4.0.alpha.sisense lib/playbook/forms/builder.rb
playbook_ui-9.4.0.alpha.user.kit.bug lib/playbook/forms/builder.rb
playbook_ui-9.4.0 lib/playbook/forms/builder.rb
playbook_ui-9.3.1.pre.alpha2 lib/playbook/forms/builder.rb
playbook_ui-9.4.0.pre.alpha2 lib/playbook/forms/builder.rb
playbook_ui-9.4.0.pre.alpha1 lib/playbook/forms/builder.rb