Sha256: fd78b689703ac3cebad7060045a8aa07698a7b4cca18d5e61a400a9160abaf9f

Contents?: true

Size: 1.36 KB

Versions: 10

Compression:

Stored size: 1.36 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/multi_level_select_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

10 entries across 10 versions & 1 rubygems

Version Path
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements842 lib/playbook/forms/builder.rb
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements837 lib/playbook/forms/builder.rb
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements835 lib/playbook/forms/builder.rb
playbook_ui-12.26.0.pre.alpha.railsmultilevelimprovements805 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements785 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements780 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements776 lib/playbook/forms/builder.rb
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements758 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements749 lib/playbook/forms/builder.rb
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements742 lib/playbook/forms/builder.rb