Sha256: 96ee43d34c426768ef9cbf964ecd4a7cf6bd6b4ec3338227a5109dd52c278873

Contents?: true

Size: 733 Bytes

Versions: 28

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

28 entries across 28 versions & 1 rubygems

Version Path
playbook_ui-14.9.0.pre.alpha.pbntr700newresettodefaultprop4736 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.10.0.pre.rc.0 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.18 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.17 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.16 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.15 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.14 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.13 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.12 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.11 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.10 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.PBNTR713dropdowncustomtriggerbug4696 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.9 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.PLAY1680newwidthprop4661 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.PLAY1658tanstackbump4657 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 lib/playbook/forms/builder/typeahead_field.rb
playbook_ui-14.9.0.pre.rc.8 lib/playbook/forms/builder/typeahead_field.rb
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