Skip to content

Commit 4c89a68

Browse files
authored
Merge branch 'develop' into develop
2 parents a62ca9c + 571635c commit 4c89a68

File tree

16 files changed

+284
-195
lines changed

16 files changed

+284
-195
lines changed

docs/src/pages/components/Dialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@
534534
:md-cancel-text="prompt.cancel"
535535
@open="onOpen"
536536
@close="onClose"
537+
v-model="prompt.value"
537538
ref="dialog6">
538539
</md-dialog-prompt>
539540

docs/src/pages/components/List.vue

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,17 @@
974974

975975
<div slot="code">
976976
<code-block lang="xml">
977+
&lt;div class="phone-viewport"&gt;
978+
&lt;md-list&gt;
979+
&lt;md-list-item&gt;Plain Text&lt;/md-list-item&gt;
980+
&lt;md-list-item target="_blank" href="https://google.com"&gt;Link&lt;/md-list-item&gt;
981+
&lt;md-list-item @click.native="openAlert"&gt;Button&lt;/md-list-item&gt;
982+
&lt;md-list-item&gt;
983+
&lt;router-link to="/components/list"&gt;Router View&lt;/router-link&gt;
984+
&lt;/md-list-item&gt;
985+
&lt;/md-list&gt;
986+
&lt;/div&gt;
987+
977988
&lt;div class=&quot;phone-viewport&quot;&gt;
978989
&lt;md-list&gt;
979990
&lt;md-list-item&gt;
@@ -1022,6 +1033,55 @@
10221033
&lt;/md-list-item&gt;
10231034
&lt;/md-list&gt;
10241035
&lt;/div&gt;
1036+
1037+
&lt;div class="phone-viewport"&gt;
1038+
&lt;md-list&gt;
1039+
&lt;md-list-item md-expand-multiple&gt;
1040+
&lt;md-icon&gt;whatshot&lt;/md-icon&gt;
1041+
&lt;span&gt;News&lt;/span&gt;
1042+
1043+
&lt;md-list-expand&gt;
1044+
&lt;md-list&gt;
1045+
&lt;md-list-item class="md-inset"&gt;World&lt;/md-list-item&gt;
1046+
&lt;md-list-item class="md-inset"&gt;Americas&lt;/md-list-item&gt;
1047+
&lt;md-list-item class="md-inset"&gt;Europe&lt;/md-list-item&gt;
1048+
&lt;/md-list&gt;
1049+
&lt;/md-list-expand&gt;
1050+
&lt;/md-list-item&gt;
1051+
1052+
&lt;md-list-item md-expand-multiple&gt;
1053+
&lt;md-icon&gt;videogame_asset&lt;/md-icon&gt;
1054+
&lt;span&gt;Games&lt;/span&gt;
1055+
1056+
&lt;md-list-expand&gt;
1057+
&lt;md-list&gt;
1058+
&lt;md-list-item class="md-inset"&gt;Console&lt;/md-list-item&gt;
1059+
&lt;md-list-item class="md-inset"&gt;PC&lt;/md-list-item&gt;
1060+
&lt;md-list-item class="md-inset"&gt;Phone&lt;/md-list-item&gt;
1061+
&lt;/md-list&gt;
1062+
&lt;/md-list-expand&gt;
1063+
&lt;/md-list-item&gt;
1064+
1065+
&lt;md-list-item md-expand-multiple&gt;
1066+
&lt;md-icon&gt;video_library&lt;/md-icon&gt;
1067+
&lt;span&gt;Video&lt;/span&gt;
1068+
1069+
&lt;md-list-expand&gt;
1070+
&lt;md-list&gt;
1071+
&lt;md-list-item class="md-inset"&gt;Humor&lt;/md-list-item&gt;
1072+
&lt;md-list-item class="md-inset"&gt;Music&lt;/md-list-item&gt;
1073+
&lt;md-list-item class="md-inset"&gt;Movies&lt;/md-list-item&gt;
1074+
&lt;md-list-item class="md-inset"&gt;TV Shows&lt;/md-list-item&gt;
1075+
&lt;/md-list&gt;
1076+
&lt;/md-list-expand&gt;
1077+
&lt;/md-list-item&gt;
1078+
1079+
&lt;md-list-item&gt;
1080+
&lt;md-icon&gt;shopping_basket&lt;/md-icon&gt;
1081+
&lt;span&gt;Shop&lt;/span&gt;
1082+
&lt;/md-list-item&gt;
1083+
&lt;/md-list&gt;
1084+
&lt;/div&gt;
10251085
</code-block>
10261086
</div>
10271087
</example-box>

src/components/mdBottomBar/mdBottomBarItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
mdIconSrc: String,
2929
mdIconset: String,
3030
mdActive: Boolean,
31-
disabled: String,
31+
disabled: Boolean,
3232
href: String
3333
},
3434
data() {

src/components/mdMenu/mdMenuContent.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@
5050
},
5151
fireClick() {
5252
if (this.highlighted > 0) {
53-
this.$children[0].$children[this.highlighted - 1].$el.click();
53+
this.getOptions()[this.highlighted - 1].$el.click();
5454
}
55+
},
56+
getOptions() {
57+
return this.$children[0].$children.filter((child) => {
58+
return child.$el.classList.contains('md-option');
59+
});
5560
}
5661
},
5762
mounted() {

src/components/mdRadio/mdRadio.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '../../core/stylesheets/variables.scss';
2+
@import '../mdCheckbox/mdCheckbox.scss';
23

34
$radio-size: 20px;
4-
$radio-ripple-size: 48px;
55
$radio-touch-size: 48px;
66

77
.md-radio {
@@ -58,8 +58,8 @@ $radio-touch-size: 48px;
5858
color: rgba(#000, .54);
5959

6060
.md-ripple {
61-
width: $radio-ripple-size !important;
62-
height: $radio-ripple-size !important;
61+
width: $radio-touch-size !important;
62+
height: $radio-touch-size !important;
6363
top: 0 !important;
6464
right: 0 !important;
6565
bottom: 0 !important;

src/components/mdRadio/mdRadio.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="md-radio" :class="[themeClass, classes]">
33
<div class="md-radio-container" @click="toggleCheck">
4-
<input type="radio" :name="name" :id="id" :disabled="disabled" :value="value">
4+
<input type="radio" :name="name" :id="id" :disabled="disabled" :value="value" @click="toggleCheck">
55
<md-ink-ripple :md-disabled="disabled" />
66
</div>
77

@@ -32,7 +32,7 @@
3232
computed: {
3333
classes() {
3434
return {
35-
'md-checked': typeof this.value !== 'undefined' && this.mdValue.toString() === this.value.toString(),
35+
'md-checked': typeof this.value !== 'undefined' && this.value !== null && this.mdValue.toString() === this.value.toString(),
3636
'md-disabled': this.disabled
3737
};
3838
}

src/components/mdSelect/mdOption.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
export default {
2323
name: 'md-option',
2424
props: {
25-
value: [String, Boolean, Number]
25+
value: [String, Boolean, Number, Object]
2626
},
2727
data: () => ({
2828
parentSelect: {},

src/components/mdSnackbar/mdSnackbar.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,3 @@ $snackbar-space: $snackbar-height / 2;
177177
}
178178
}
179179
}
180-
181-
.md-has-toast {
182-
.md-fab.md-fab-top-right,
183-
.md-fab.md-fab-top-center,
184-
.md-fab.md-fab-top-left {
185-
@include layout-xsmall {
186-
transform: translate3D(0, $snackbar-height - 4px, 0);
187-
}
188-
}
189-
190-
.md-fab.md-fab-bottom-right,
191-
.md-fab.md-fab-bottom-center,
192-
.md-fab.md-fab-bottom-left {
193-
@include layout-xsmall {
194-
transform: translate3D(0, -$snackbar-height + 4px, 0);
195-
}
196-
}
197-
}

src/components/mdSwitch/mdSwitch.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
data() {
3939
return {
4040
leftPos: initialPosition,
41-
checked: this.value
41+
checked: Boolean(this.value)
4242
};
4343
},
4444
computed: {
4545
classes() {
4646
return {
47-
'md-checked': Boolean(this.value),
47+
'md-checked': this.checked,
4848
'md-disabled': this.disabled
4949
};
5050
},

src/components/mdTable/mdTablePagination.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949
subTotal: 0,
5050
totalItems: 0,
5151
currentPage: 1,
52-
currentSize: 0
52+
currentSize: parseInt(this.mdSize, 10)
5353
};
5454
},
5555
watch: {
5656
mdTotal(val) {
57+
const sub = this.currentPage * this.currentSize;
58+
59+
this.subTotal = sub > val ? val : sub;
5760
this.totalItems = isNaN(val) ? Number.MAX_SAFE_INTEGER : parseInt(val, 10);
5861
},
5962
mdSize(val) {
@@ -108,7 +111,7 @@
108111
this.$nextTick(() => {
109112
this.subTotal = this.currentPage * this.currentSize;
110113
this.mdPageOptions = this.mdPageOptions || [10, 25, 50, 100];
111-
this.currentSize = this.mdPageOptions[0];
114+
this.currentSize = this.mdPageOptions.includes(this.currentSize) ? this.currentSize : this.mdPageOptions[0];
112115
this.canFireEvents = true;
113116
});
114117
}

src/core/components/mdTheme/dom.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
export var changeHtmlMetaColor;
2+
export var createNewStyleElement;
3+
4+
if (process.env.VUE_ENV !== 'server') {
5+
changeHtmlMetaColor = (color, themeClass, previousClass) => {
6+
var elem = document.querySelector('meta[name="theme-color"]');
7+
8+
if (elem) {
9+
elem.setAttribute('content', color);
10+
} else {
11+
elem = document.createElement('meta');
12+
elem.setAttribute('name', 'theme-color');
13+
elem.setAttribute('content', color);
14+
15+
document.head.appendChild(elem);
16+
}
17+
18+
document.body.classList.remove(previousClass);
19+
document.body.classList.add(themeClass);
20+
};
21+
22+
createNewStyleElement = (style, styleId) => {
23+
const head = document.head;
24+
const styleElement = head.querySelector('#' + styleId);
25+
26+
if (!styleElement) {
27+
const newTag = document.createElement('style');
28+
29+
newTag.type = 'text/css';
30+
newTag.id = styleId;
31+
newTag.textContent = style;
32+
33+
head.appendChild(newTag);
34+
} else {
35+
styleElement.textContent = style;
36+
}
37+
};
38+
}

0 commit comments

Comments
 (0)