Skip to content

Commit 20f0a83

Browse files
committed
Merge remote-tracking branch 'origin/develop' into components/mdDatepicker
* origin/develop: fix keycode recognition with german keyboards on mdChips (vuematerial#495) add support to router-link with md-button as tag vuematerial#470 remove search field on toolbar example remove search field on toolbar example add scrollbar in phone viewport clear input container state if model is falsy fix icon src of bottombar item prevent ripple from being created multiple times in parent add md-clearable to md-input-container (vuematerial#473) scroll selected option into view fix spacing add name to all components scroll selected option into view fix ripple effect on touchscreen desktops (vuematerial#479)
2 parents 9e8a623 + 5d3091a commit 20f0a83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+233
-41
lines changed

docs/src/pages/components/Input.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<md-table-cell><code>Boolean</code></md-table-cell>
2929
<md-table-cell>Show a button to toggle the password visibility. Default <code>false</code></md-table-cell>
3030
</md-table-row>
31+
32+
<md-table-row>
33+
<md-table-cell>md-clearable</md-table-cell>
34+
<md-table-cell><code>Boolean</code></md-table-cell>
35+
<md-table-cell>Show a button to clear the input. Default <code>false</code></md-table-cell>
36+
</md-table-row>
3137
</md-table-body>
3238
</md-table>
3339

@@ -176,6 +182,11 @@
176182
<label>Disabled</label>
177183
<md-input disabled></md-input>
178184
</md-input-container>
185+
186+
<md-input-container md-clearable>
187+
<label>Clearable</label>
188+
<md-input v-model="initialValue"></md-input>
189+
</md-input-container>
179190
</form>
180191
</div>
181192

@@ -211,6 +222,11 @@
211222
&lt;label&gt;Disabled&lt;/label&gt;
212223
&lt;md-input disabled&gt;&lt;/md-input&gt;
213224
&lt;/md-input-container&gt;
225+
226+
&lt;md-input-container md-clearable&gt;
227+
&lt;label&gt;Clearable&lt;/label&gt;
228+
&lt;md-input v-model=&quot;initialValue&quot;&gt;&lt;/md-input&gt;
229+
&lt;/md-input-container&gt;
214230
&lt;/form&gt;
215231
</code-block>
216232

docs/src/pages/components/List.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@
10331033
<style lang="sass" scoped>
10341034
.phone-viewport {
10351035
height: 480px;
1036+
overflow: auto;
10361037
}
10371038
10381039
.custom-list {

docs/src/pages/components/Toolbar.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@
9090
<md-icon>menu</md-icon>
9191
</md-button>
9292

93-
<h2 class="md-title">Default</h2>
94-
95-
<md-input-container style="flex: 1">
96-
<md-input placeholder="Search..." />
97-
</md-input-container>
93+
<h2 class="md-title" style="flex: 1">Default</h2>
9894

9995
<md-button class="md-icon-button">
10096
<md-icon>favorite</md-icon>

src/components/mdAvatar/mdAvatar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import theme from '../../core/components/mdTheme/mixin';
1111
1212
export default {
13+
name: 'md-avatar',
1314
mixins: [theme]
1415
};
1516
</script>

src/components/mdBackdrop/mdBackdrop.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
export default {
9+
name: 'md-backdrop',
910
methods: {
1011
close() {
1112
this.$emit('close');

src/components/mdBottomBar/mdBottomBar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import theme from '../../core/components/mdTheme/mixin';
1111
1212
export default {
13+
name: 'md-bottom-bar',
1314
props: {
1415
mdShift: Boolean
1516
},

src/components/mdBottomBar/mdBottomBarItem.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<a :href="href" class="md-bottom-bar-item" :class="classes" :disabled="disabled" @click="setActive" v-if="href">
3-
4-
<md-icon v-if="mdIcon || mdIconSrc || mdIconset" :md-icon-src="mdIconSrc" :md-iconset="mdIconset">{{ mdIcon }}</md-icon>
3+
<md-icon v-if="mdIcon || mdIconSrc || mdIconset" :md-src="mdIconSrc" :md-iconset="mdIconset">{{ mdIcon }}</md-icon>
54

65
<md-ink-ripple :md-disabled="disabled" />
76

@@ -11,7 +10,6 @@
1110
</a>
1211

1312
<button type="button" class="md-bottom-bar-item" :class="classes" :disabled="disabled" @click="setActive" v-else>
14-
1513
<md-icon v-if="mdIcon || mdIconSrc || mdIconset" :md-src="mdIconSrc" :md-iconset="mdIconset">{{ mdIcon }}</md-icon>
1614

1715
<md-ink-ripple :md-disabled="disabled" />
@@ -24,6 +22,7 @@
2422

2523
<script>
2624
export default {
25+
name: 'md-bottom-bar-item',
2726
props: {
2827
mdIcon: String,
2928
mdIconSrc: String,

src/components/mdButton/mdButton.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<button class="md-button" :class="[themeClass]" :type="type" :disabled="disabled" v-if="!href">
2+
<a class="md-button" :class="[themeClass]" :href="href" :disabled="disabled" :target="target" :rel="newRel" @click="$emit('click', $event)" v-if="href">
33
<md-ink-ripple :md-disabled="disabled"></md-ink-ripple>
44
<slot></slot>
5-
</button>
5+
</a>
66

7-
<a class="md-button" :class="[themeClass]" :href="href" :disabled="disabled" :target="target" :rel="newRel" v-else>
7+
<button class="md-button" :class="[themeClass]" :type="type" :disabled="disabled" @click="$emit('click', $event)" v-else>
88
<md-ink-ripple :md-disabled="disabled"></md-ink-ripple>
99
<slot></slot>
10-
</a>
10+
</button>
1111
</template>
1212

1313
<style lang="scss" src="./mdButton.scss"></style>
@@ -16,6 +16,7 @@
1616
import theme from '../../core/components/mdTheme/mixin';
1717
1818
export default {
19+
name: 'md-button',
1920
props: {
2021
href: String,
2122
target: String,

src/components/mdButtonToggle/mdButtonToggle.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
let onClickButton;
1313
1414
export default {
15+
name: 'md-button-toggle',
1516
props: {
1617
mdSingle: Boolean
1718
},

src/components/mdCard/mdCard.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import theme from '../../core/components/mdTheme/mixin';
1111
1212
export default {
13+
name: 'md-card',
1314
props: {
1415
mdWithHover: Boolean
1516
},

src/components/mdCard/mdCardActions.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-card-actions'
10+
};
11+
</script>

src/components/mdCard/mdCardArea.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
export default {
9+
name: 'md-card-area',
910
props: {
1011
mdInset: Boolean
1112
},

src/components/mdCard/mdCardContent.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-card-content'
10+
};
11+
</script>

src/components/mdCard/mdCardExpand.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
export default {
9+
name: 'md-card-expand',
910
methods: {
1011
setContentMargin() {
1112
this.content.style.marginTop = -this.content.offsetHeight + 'px';

src/components/mdCard/mdCardHeader.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-card-header'
10+
};
11+
</script>

src/components/mdCard/mdCardHeaderText.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
export default {
9+
name: 'md-card-header-text',
910
mounted() {
1011
this.parentClasses = this.$parent.$el.classList;
1112

src/components/mdCard/mdCardMedia.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
export default {
9+
name: 'md-card-media',
910
props: {
1011
mdRatio: String,
1112
mdMedium: Boolean,

src/components/mdCard/mdCardMediaActions.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-card-media-actions'
10+
};
11+
</script>

src/components/mdCard/mdCardMediaCover.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import getImageLightness from '../../core/utils/getImageLightness';
1010
1111
export default {
12+
name: 'md-card-media-cover',
1213
props: {
1314
mdTextScrim: Boolean,
1415
mdSolid: Boolean

src/components/mdCheckbox/mdCheckbox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import theme from '../../core/components/mdTheme/mixin';
1818
1919
export default {
20+
name: 'md-checkbox',
2021
props: {
2122
name: String,
2223
value: [String, Boolean],

src/components/mdChips/mdChip.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import theme from '../../core/components/mdTheme/mixin';
1818
1919
export default {
20+
name: 'md-chip',
2021
props: {
2122
disabled: Boolean,
2223
mdDeletable: Boolean

src/components/mdChips/mdChips.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
:disabled="disabled"
2020
@keydown.native.delete="deleteLastChip"
2121
@keydown.native.prevent.enter="addChip"
22-
@keydown.native.prevent.186="addChip"
2322
tabindex="0"
2423
ref="input">
2524
</md-input>
@@ -34,6 +33,7 @@
3433
import uniqueId from '../../core/utils/uniqueId';
3534
3635
export default {
36+
name: 'md-chips',
3737
props: {
3838
value: Array,
3939
disabled: Boolean,

src/components/mdDialog/mdDialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import transitionEndEventName from '../../core/utils/transitionEndEventName';
1616
1717
export default {
18+
name: 'md-dialog',
1819
props: {
1920
mdClickOutsideToClose: {
2021
type: Boolean,

src/components/mdDialog/mdDialogActions.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-dialog-actions'
10+
};
11+
</script>

src/components/mdDialog/mdDialogContent.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-dialog-content'
10+
};
11+
</script>

src/components/mdDialog/mdDialogTitle.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<slot></slot>
44
</div>
55
</template>
6+
7+
<script>
8+
export default {
9+
name: 'md-dialog-title'
10+
};
11+
</script>

src/components/mdDialog/presets/mdDialogAlert.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<script>
1515
export default {
16+
name: 'md-dialog-alert',
1617
props: {
1718
mdTitle: String,
1819
mdContent: String,

src/components/mdDialog/presets/mdDialogConfirm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<script>
1616
export default {
17+
name: 'md-dialog-confirm',
1718
props: {
1819
mdTitle: String,
1920
mdContent: String,

src/components/mdDialog/presets/mdDialogPrompt.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
<script>
2929
export default {
30+
name: 'md-dialog-prompt',
3031
props: {
3132
value: {
3233
type: [String, Number],

src/components/mdDivider/mdDivider.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
</template>
44

55
<style lang="scss" src="./mdDivider.scss"></style>
6+
7+
<script>
8+
export default {
9+
name: 'md-divider'
10+
};
11+
</script>

src/components/mdFile/mdFile.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import getClosestVueParent from '../../core/utils/getClosestVueParent';
3030
3131
export default {
32+
name: 'md-file',
3233
props: {
3334
value: String,
3435
id: String,

src/components/mdIcon/mdIcon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
let registeredIcons = {};
1717
1818
export default {
19+
name: 'md-icon',
1920
props: {
2021
mdSrc: String,
2122
mdIconset: {

src/components/mdImage/mdImage.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import getImageLightness from '../../core/utils/getImageLightness';
99
1010
export default {
11+
name: 'md-image',
1112
props: {
1213
mdSrc: String
1314
},

src/components/mdInputContainer/common.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ export default {
77
placeholder: String
88
},
99
watch: {
10-
value(value) {
11-
this.setParentValue(value);
12-
this.updateValues(value);
10+
value() {
11+
this.updateValues();
1312
},
1413
disabled() {
1514
this.setParentDisabled();
@@ -41,11 +40,13 @@ export default {
4140
setParentPlaceholder() {
4241
this.parentContainer.hasPlaceholder = !!this.placeholder;
4342
},
44-
updateValues(value) {
45-
const newValue = value || this.$el.value || this.value;
43+
updateValues() {
44+
this.$nextTick(() => {
45+
const newValue = this.$el.value || this.value;
4646

47-
this.setParentValue(newValue);
48-
this.parentContainer.inputLength = newValue ? newValue.length : 0;
47+
this.setParentValue(newValue);
48+
this.parentContainer.inputLength = newValue ? newValue.length : 0;
49+
});
4950
},
5051
onFocus() {
5152
if (this.parentContainer) {

0 commit comments

Comments
 (0)