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-12.25.0.pre.alpha.PLAY818multilevelrebuild773 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild770 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.play822bolddefaultfortitle3764 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.PLAY733DetailKit761 lib/playbook/forms/builder.rb
playbook_ui-12.25.0 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown756 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown752 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3721 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.alphatestforselfhostfak720 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3719 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3717 lib/playbook/forms/builder.rb
playbook_ui-12.24.0 lib/playbook/forms/builder.rb
playbook_ui-12.23.0.pre.alpha.movemarkdown712 lib/playbook/forms/builder.rb
playbook_ui-12.23.0.pre.alpha.movemarkdown708 lib/playbook/forms/builder.rb
playbook_ui-12.23.0.pre.alpha.play698responsivespacingglobalprop703 lib/playbook/forms/builder.rb
playbook_ui-12.23.0.pre.alpha.play698responsivespacingglobalprop701 lib/playbook/forms/builder.rb
playbook_ui-12.23.0 lib/playbook/forms/builder.rb
playbook_ui-12.22.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown696 lib/playbook/forms/builder.rb
playbook_ui-12.22.0.pre.alpha.play698responsivespacingglobalprop690 lib/playbook/forms/builder.rb
playbook_ui-12.22.0.pre.alpha.PBNTR12checkingemptyfilters686 lib/playbook/forms/builder.rb