Sha256: 02601de95a19281abe7cad76be31431f088bcf65a1b504f4d03481e317da3e0a

Contents?: true

Size: 1.39 KB

Versions: 2023

Compression:

Stored size: 1.39 KB

Contents

<div>
  <%= pb_rails("form_group") do %>
    <%
      options = [
        { label: 'Windows', value: 'windows' },
        { label: 'Roof', value: 'roof' },
        { label: 'Siding', value: 'siding' },
        { label: 'Doors', value: 'doors' },
      ]
    %>
    <%= pb_rails("typeahead", props: {
      default_options: [options.first],
      id: "form-group-typeahead-example",
      label: "Products",
      options: options,
    }) %>
    <%= pb_rails("button", props: {
      id: "form-group-button",
      text: "Add",
      variant: "secondary"
    }) %>
  <% end %>
</div>

<!-- This section is an example of the available JavaScript event hooks -->
<%= javascript_tag defer: "defer" do %>
  document.addEventListener("pb-form-group-kit-form-group-typeahead-example-result-option-select", function(event) {
    console.log('Option selected')
    console.dir(event.detail)
  })
  document.addEventListener("pb-form-group-kit-form-group-typeahead-example-result-option-remove", function(event) {
    console.log('Option removed')
    console.dir(event.detail)
  })
  document.addEventListener("pb-form-group-kit-form-group-typeahead-example-result-option-clear", function() {
    console.log('All options cleared')
  })

  document.querySelector('#form-group-button').addEventListener('click', function() {
    document.dispatchEvent(new CustomEvent('pb-form-group-kit-form-group-typeahead:clear'))
  })
<% end %>

Version data entries

2,023 entries across 2,023 versions & 2 rubygems

Version Path
playbook_ui-9.3.0.alpha.inline1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.3.0.pre.alpha.password.strength.1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.3.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.2.2.pre.alpha.margin app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.2.2 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.2.1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.2.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.1.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-9.0.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.3.0.alpha.select.pre.margin app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.3.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb
playbook_ui-8.2.1 app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb