Sha256: 5178096be404e3005e6855a914f2fa25763ee0e3e8a728b3fc5017d570a06519

Contents?: true

Size: 1.56 KB

Versions: 349

Compression:

Stored size: 1.56 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"
      require_relative "builder/intl_telephone_field"
      require_relative "builder/multi_level_select_field"
      require_relative "builder/phone_number_field"
      require_relative "builder/dropdown_field"
      require_relative "builder/star_rating_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

349 entries across 349 versions & 1 rubygems

Version Path
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3953 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3950 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PBNTR374multilevelselectPOC3946 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3944 lib/playbook/forms/builder.rb
playbook_ui-14.6.0.pre.rc.1 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.psych4support3941 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3940 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.javascriptassets3939 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.javascriptassets3932 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3931 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3930 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.javascriptassets3929 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.javascriptassets3928 lib/playbook/forms/builder.rb
playbook_ui-14.5.0.pre.alpha.javascriptassets3926 lib/playbook/forms/builder.rb
playbook_ui-14.6.0.pre.rc.0 lib/playbook/forms/builder.rb
playbook_ui-14.4.0.pre.alpha.javascriptassets3924 lib/playbook/forms/builder.rb
playbook_ui-14.4.0.pre.alpha.PLAY1486highchartscssdrivenPOC3923 lib/playbook/forms/builder.rb
playbook_ui-14.5.0 lib/playbook/forms/builder.rb
playbook_ui-14.4.0.pre.alpha.stephenagreerpatch13922 lib/playbook/forms/builder.rb
playbook_ui-14.4.0.pre.alpha.PLAY1486highchartscssdrivenPOC3921 lib/playbook/forms/builder.rb