Default Template
Custom Template
Chips with Autocomplete
Chips with Autocomplete (requires match)
Template
<h2>Default Template</h2>
<PaperChips @content={{this.fruitNames}} @readOnly={{this.readOnly}} @removeItem={{action "removeItem"}} @addItem={{action "addItem"}} @placeholder="Add a tag" />
<h2>Custom Template</h2>
<PaperChips @readOnly={{this.readOnly}} @removeItem={{action "removeCustomItem"}} @addItem={{action "addCustomItem"}} @placeholder="Add a tag" @content={{this.customFruitNames}} as |item|>
<strong>{{item}}</strong>
<em>(fruit)</em>
</PaperChips>
<h2>Chips with Autocomplete</h2>
<PaperChips @readOnly={{this.readOnly}} @removeItem={{action "removeVegetable"}} @addItem={{action "addVegetable"}} @placeholder="Add a vegetable" @content={{this.vegetables}} @options={{this.remainingVegetables}} @searchField="name" @noMatchesMessage="Not found. Click to add." as |item|>
<strong>{{item.name}}</strong>
{{#if item.family}}
<em>{{item.family}}</em>
{{/if}}
</PaperChips>
<h2>Chips with Autocomplete (requires match)</h2>
<PaperChips @readOnly={{this.readOnly}} @removeItem={{action "removeVegeName"}} @addItem={{action "addVegeName"}} @placeholder="Add a vegetable" @content={{this.vegeNames}} @options={{this.remainingVegeNames}} @requireMatch={{true}} />
Contact Chips
paper-contact-chipsexpects the name, email address and image to be supplied asname,imagerespectively. If your field names differ from these, specify them using thenameField,emailFieldandimageFieldparameters, and specifysearchFieldto configure which field the autocomplete should search against:
Read Only
Template
<h2>Contact Chips</h2>
<PaperContactChips @readOnly={{this.readOnly}} @removeItem={{action "removeContact"}} @addItem={{action "addContact"}} @placeholder="Add a contact" @content={{this.selectedContacts}} @options={{this.remainingContacts}} />
<blockquote>
<code>paper-contact-chips</code> expects the name, email address and image
to be supplied as <code>name</code>, <code>email</code> and <code>image</code>
respectively. If your field names differ from these, specify them using the
<code>nameField</code>, <code>emailField</code> and <code>imageField</code>
parameters, and specify <code>searchField</code> to configure which field the
autocomplete should search against:
</blockquote>
<PaperContactChips @readOnly={{this.readOnly}} @removeItem={{action "removeAltContact"}} @addItem={{action "addAltContact"}} @placeholder="Add a contact" @content={{this.selectedAltContacts}} @options={{this.remainingAltContacts}} @nameField="shortName" @emailField="emailAddress" @imageField="profileImage" @searchField="emailAddress" />
<PaperCheckbox @value={{this.readOnly}} @onChange={{action (mut this.readOnly)}}>
Read Only
</PaperCheckbox>