Sha256: 60748aa2f820a4774d4a6440cb60d7ad650982f22dbed303e70874ee30c2f90e

Contents?: true

Size: 858 Bytes

Versions: 197

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

# require_dependency "app/pb_kits/playbook/pb_form/form_builder"

module Playbook
  module PbForm
    class Form
      include Playbook::Props

      clear_props
      prop :form_system, type: Playbook::Props::Enum,
                         values: %w[form_with simple_form],
                         default: "form_with"
      prop :form_system_options, type: Playbook::Props::Base
      prop :children, type: Playbook::Props::Proc
      prop :validate, type: Playbook::Props::Boolean, default: false

      delegate :to_partial_path, to: :specific_form
      delegate :merged_form_system_options, to: :specific_form
      delegate :form_builder, to: :specific_form

    private

      def specific_form
        @specific_form ||= "#{self.class}::#{form_system.classify}Form".constantize.new(self)
      end
    end
  end
end

Version data entries

197 entries across 197 versions & 1 rubygems

Version Path
playbook_ui-7.16.0.pre.alpha5 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.16.0.pre.alpha4 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.16.0.pre.alpha3 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.16.0.pre.alpha2 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.16.0.pre.alpha1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.16.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.15.1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.15.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.14.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.13.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.12.1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.12.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.11.1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.11.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_form/form.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_form/form.rb