Sha256: 96ee43d34c426768ef9cbf964ecd4a7cf6bd6b4ec3338227a5109dd52c278873

Contents?: true

Size: 733 Bytes

Versions: 30

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Forms
    class Builder
      def typeahead(name, _options = {}, _html_options = {}, props: {})
        props[:name] = name

        input_id = "#{name}_input"
        props[:input_options] ||= {}
        props[:input_options][:id] ||= input_id

        props[:label] = @template.label(@object_name, name, for: props[:input_options][:id]) if props[:label] == true

        if props[:validation]
          validation_message = props[:validation][:message]
          props[:input_options][:data] ||= {}
          props[:input_options][:data][:validation_message] = validation_message
        end

        @template.pb_rails("typeahead", props: props)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.7 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.7.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4523 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.rc.7 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.rc.6 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.rc.5 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.rc.4 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 lib/playbook/forms/builder/typeahead_field.rb