Sha256: 7dbba92b48d032b8bb905ce191bf8273a6ae8cfe07645c6a23acf37753278993

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

module Plutonium
  module UI
    module Form
      module Options
        module InferredTypes
          private

          def infer_field_component
            case inferred_field_type
            when :rich_text
              return :markdown
            end

            inferred_field_component = super
            case inferred_field_component
            when :select
              :slim_select
            when :date, :time, :datetime
              :flatpickr
            else
              inferred_field_component
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plutonium-0.16.3 lib/plutonium/ui/form/options/inferred_types.rb
plutonium-0.16.1 lib/plutonium/ui/form/options/inferred_types.rb
plutonium-0.16.0 lib/plutonium/ui/form/options/inferred_types.rb