Skip to content

Commit

Permalink
feat(MdChips): Support with field variants (#1668)
Browse files Browse the repository at this point in the history
* feat(MdChips): Support with field variants

* docs(MdChips): Support with field variants
  • Loading branch information
shafimsp authored and marcosmoura committed May 13, 2018
1 parent 665732c commit c502a16
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/app/pages/Components/Chips/Chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default {
defaults: 'text'
},
{
name: 'md-placeholder',
name: 'placeholder',
type: 'String',
description: 'The input placeholder. It is useful to show to the user which type of data will be inserted.',
defaults: 'null'
Expand Down
13 changes: 7 additions & 6 deletions docs/app/pages/Components/Chips/examples/ChipCustomTemplate.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<template>
<div>
<md-chips v-model="projects" :md-limit="5" md-placeholder="Add project...">
<template slot="md-chip" slot-scope="{ chip }">
{{ chip }} <small v-if="chip === currentProject">(Marcos Moura)</small>
</template>

<md-field>
<md-chips v-model="projects" :md-limit="5" md-placeholder="Add project...">
<template slot="md-chip" slot-scope="{ chip }">
{{ chip }} <small v-if="chip === currentProject">(Marcos Moura)</small>
</template>
</md-chips>
<div class="md-helper-text">Up to 5 projects</div>
</md-chips>
</md-field>
</div>
</template>

Expand Down
17 changes: 11 additions & 6 deletions docs/app/pages/Components/Chips/examples/DuplicatedFeedback.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<template>
<div>
<md-chips class="md-primary" v-model="chips" md-placeholder="Add genre...">
<md-field>
<md-chips class="md-primary" v-model="chips" md-placeholder="Add genre..."></md-chips>
<div class="md-helper-text">Default</div>
</md-chips>
<md-chips class="md-primary shake-on-error" v-model="chips" md-placeholder="Add genre...">
</md-field>

<md-field>
<md-chips class="md-primary shake-on-error" v-model="chips" md-placeholder="Add genre..."></md-chips>
<div class="md-helper-text">Shake duplicated chip on insertion</div>
</md-chips>
<md-chips class="md-primary pulse-on-error" v-model="chips" md-placeholder="Add genre..." md-check-duplicated>
</md-field>

<md-field>
<md-chips class="md-primary pulse-on-error" v-model="chips" md-placeholder="Add genre..." md-check-duplicated></md-chips>
<div class="md-helper-text">Always pulse duplicated chip</div>
</md-chips>
</md-field>
</div>
</template>

Expand Down
4 changes: 3 additions & 1 deletion docs/app/pages/Components/Chips/examples/Editable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div>
<md-chips v-model="fruits" md-placeholder="Add fruit..."></md-chips>
<md-field>
<md-chips v-model="fruits" md-placeholder="Add fruit..."></md-chips>
</md-field>
</div>
</template>

Expand Down
12 changes: 7 additions & 5 deletions docs/app/pages/Components/Chips/examples/Format.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<template>
<div>
<md-chips class="md-primary" v-model="clubs" md-placeholder="Add club..." :md-format="toUppercase">
<md-field>
<label>La Liga Clubs</label>
<md-chips class="md-primary" v-model="clubs" :md-format="toUppercase"></md-chips>
<div class="md-helper-text">Three uppercase letters</div>
</md-chips>
<md-chips class="md-primary" v-model="artists" md-placeholder="Add artist..." :md-format="formatName">
</md-field>

<md-field>
<label>Artists</label>
<md-chips class="md-primary" v-model="artists" placeholder="Add artist..." :md-format="formatName"></md-chips>
<div class="md-helper-text">Try inserting `Eugène Ysaÿe`. The formatter will remove diacritics.</div>
</md-chips>
</md-field>
</div>
</template>

Expand Down
4 changes: 3 additions & 1 deletion docs/app/pages/Components/Chips/examples/Static.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div>
<md-chips v-model="cities" md-static></md-chips>
<md-field>
<md-chips v-model="cities" readonly></md-chips>
</md-field>
</div>
</template>

Expand Down
Loading

1 comment on commit c502a16

@marcosmoura
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was reverted. Due to the new changes on Material Design guidelines, this will no longer be applied.

Please sign in to comment.