Sha256: 65508e7e356c7585972113d641f6d1926e42b049070ea2084bc0cdcf05e0cff4

Contents?: true

Size: 1.51 KB

Versions: 40

Compression:

Stored size: 1.51 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"

      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

40 entries across 40 versions & 1 rubygems

Version Path
playbook_ui-13.32.0.pre.alpha.PLAY14143288 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143272 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143271 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143267 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3266 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143264 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143260 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143255 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14143251 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3239 lib/playbook/forms/builder.rb
playbook_ui-13.32.0.pre.alpha.PLAY14103236 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.play1416movealiaslogic3232 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.PBNTR342navtabbing3231 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.PBNTR342navtabbing3230 lib/playbook/forms/builder.rb
playbook_ui-13.32.0 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.powercentrainplaybookpt23212 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.PLAY10863204 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.PLAY10863202 lib/playbook/forms/builder.rb
playbook_ui-13.31.0.pre.alpha.PLAY882formpillprimaryandneutral3201 lib/playbook/forms/builder.rb