Skip to content

Commit

Permalink
feat(text-field): add text-field--box support
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Labonne authored and stasson committed Jan 8, 2018
1 parent 302e428 commit 40a03ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/textfield/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var vm = new Vue({
|`v-model`| String || binds textfield value |
|`dense`| Boolean | | compresses the textfield to make it slightly smaller |
|`label`| String | | hint text |
|`box`| Boolean | | whether the textfield is a box |
|`helptext`| String | | help text |
|`helptext-persistent`| Boolean | | whether help text is persistent |
|`helptext-validation`| Boolean | | whether help text is a validation |
Expand All @@ -69,4 +70,3 @@ var vm = new Vue({

### Reference
- <https://material.io/components/web/catalog/input-controls/text-fields>

3 changes: 3 additions & 0 deletions components/textfield/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<mdc-textfield :disabled="!enabled" v-model="textField"
label="with help text"
helptext="Help text..."></mdc-textfield>
<mdc-textfield :disabled="!enabled" v-model="textField"
label="in a box"
helptext="Help text..." box></mdc-textfield>
</mdc-layout-cell>
<mdc-layout-cell span=6>
<p><mdc-textfield :disabled="!enabled" v-model="textField" multiline
Expand Down
10 changes: 6 additions & 4 deletions components/textfield/mdc-textfield.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default {
'helptext': String,
'helptext-persistent': Boolean,
'helptext-validation': Boolean,
'box': Boolean,
'disabled': Boolean,
'required': Boolean,
'minlength': { type: [Number, String], default: undefined },
Expand All @@ -105,7 +106,8 @@ export default {
'mdc-text-field--disabled': this.disabled,
'mdc-text-field--dense': this.dense,
'mdc-text-field--fullwidth': this.fullwidth,
'mdc-text-field--textarea': this.multiline
'mdc-text-field--textarea': this.multiline,
'mdc-text-field--box': this.box
},
inputClasses: {
'mdc-text-field__input': true
Expand Down Expand Up @@ -161,10 +163,10 @@ export default {
notifyAnimationEnd: () => {
emitCustomEvent(
this.$refs.bottom,
MDCTextFieldBottomLineFoundation.strings.ANIMATION_END_EVENT,
MDCTextFieldBottomLineFoundation.strings.ANIMATION_END_EVENT,
{});
},
})
})
this.bottomLineFoundation.init()
}
Expand All @@ -188,7 +190,7 @@ export default {
setContent: (content) => {
this.$refs.help.textContent = content;
}
})
})
this.helperTextFoundation.init()
}
Expand Down

0 comments on commit 40a03ce

Please sign in to comment.