From ddafc68ae2e897199fbfc88de7032106ccd0f6cb Mon Sep 17 00:00:00 2001 From: philip ross Date: Wed, 21 Feb 2018 13:03:59 +0000 Subject: [PATCH] fix: Support leading and trailing icons simultaneously (needs material-components-web@0.31.0). Support font-awesome icons. Demonstrate custom themed chips. --- components/chips/README.md | 42 +++++----- components/chips/demo.vue | 148 ++++++++++++++++++++++++++++++++-- components/chips/mdc-chip.vue | 73 ++++++++++++----- demo/index.html | 4 +- 4 files changed, 222 insertions(+), 45 deletions(-) diff --git a/components/chips/README.md b/components/chips/README.md index 5cd77c47..c9ca07c4 100644 --- a/components/chips/README.md +++ b/components/chips/README.md @@ -1,37 +1,41 @@ ## Usage ```html - - Chip content 1 - Chip content 2 - Chip content 3 - + + + Jane Smith + John Doe + + + + + Jane Smith + John Doe + ``` ### props #### mdc-chip -mdc-chip is a compact element that allows a user to enter information or select a choice. mdc-chip dispatches -`@MDCChip:interaction` event. - -| prop | Type | Default | Description | -| -------------- | ------- | -------- | ------------------------------------------- | -| `event` | String | optional | optional event to emit on click | -| `event-target` | Object | vm.$root | optional event target, defaults to root bus | -| `event-args` | Array | [] | optional event args | -| `icon` | String | optional | optional leading or trailing icon | -| `trailing` | Boolean | false | if true icon is a trailing icon | +mdc-chip is a compact element that allows a user to enter information or select a choice. -> emits `@MDCChip:interaction` event with the chip as parameter +| prop | Type | Default | Description | +| --------------------- | ------ | -------- | --------------------------------------------- | +| `event` | String | optional | optional event to emit on click | +| `event-target` | Object | vm.$root | optional event target, defaults to root bus | +| `event-args` | Array | [] | optional event args | +| `leadingIcon` | String | optional | optional leading icon | +| `trailingIcon` | String | optional | optional trailing icon | +| `leadingIconClasses` | Object | optional | optional leading icon classes (font-awesome) | +| `trailingIconClasses` | Object | optional | optional trailing icon classes (font-awesome) | ### Chips with icons ```html - Chip content 1 - Chip content 2 - Chip content 3 + Jane Smith + John Doe ``` diff --git a/components/chips/demo.vue b/components/chips/demo.vue index da447565..4e105aac 100644 --- a/components/chips/demo.vue +++ b/components/chips/demo.vue @@ -1,9 +1,145 @@ + + diff --git a/components/chips/mdc-chip.vue b/components/chips/mdc-chip.vue index 1fd518d3..85988cce 100644 --- a/components/chips/mdc-chip.vue +++ b/components/chips/mdc-chip.vue @@ -1,38 +1,49 @@ diff --git a/demo/index.html b/demo/index.html index dcff32ce..a032add3 100644 --- a/demo/index.html +++ b/demo/index.html @@ -7,8 +7,8 @@ vue-mdc-adapter -