+
@@ -28,11 +28,16 @@
computed: {
classes() {
return {
- 'md-checked': Boolean(this.value),
+ 'md-checked': Boolean(this.checked),
'md-disabled': this.disabled
};
}
},
+ watch: {
+ value() {
+ this.checked = this.value;
+ }
+ },
methods: {
toggleCheck() {
if (!this.disabled) {
diff --git a/src/components/mdInputContainer/mdInputContainer.vue b/src/components/mdInputContainer/mdInputContainer.vue
index a997995..6ea8171 100644
--- a/src/components/mdInputContainer/mdInputContainer.vue
+++ b/src/components/mdInputContainer/mdInputContainer.vue
@@ -19,19 +19,9 @@
mdDisabled: Boolean,
mdHasPassword: Boolean
},
- computed: {
- classes() {
- return {
- 'md-input-inline': this.mdInline,
- 'md-has-password': this.mdHasPassword,
- 'md-has-select': this.mdHasSelect,
- 'md-has-value': Boolean(this.value)
- };
- }
- },
data() {
return {
- value: null,
+ value: '',
input: false,
inputType: false,
showPassword: false,
@@ -41,12 +31,27 @@
inputLength: 0
};
},
+ computed: {
+ hasValue() {
+ if (this.value.constructor === Array) {
+ return this.value.length > 0;
+ }
+
+ return Boolean(this.value);
+ },
+ classes() {
+ return {
+ 'md-input-inline': this.mdInline,
+ 'md-has-password': this.mdHasPassword,
+ 'md-has-select': this.mdHasSelect,
+ 'md-has-value': this.hasValue
+ };
+ }
+ },
methods: {
togglePasswordType() {
if (this.input.tagName.toLowerCase() === 'input') {
- let type = this.input.type;
-
- if (type === 'password') {
+ if (this.inputType === 'password') {
this.input.type = 'text';
this.showPassword = true;
} else {
diff --git a/src/components/mdMenu/mdMenu.scss b/src/components/mdMenu/mdMenu.scss
index 5a41630..a0a70c7 100644
--- a/src/components/mdMenu/mdMenu.scss
+++ b/src/components/mdMenu/mdMenu.scss
@@ -22,7 +22,7 @@ $menu-base-width: 56px;
opacity: 0;
transition: width $swift-ease-out-duration $swift-ease-out-timing-function,
opacity .25s $swift-ease-in-timing-function,
- clip-path .1s .073s $swift-ease-in-timing-function;
+ clip-path .17s .08s $swift-ease-in-timing-function;
color: rgba(#212121, .87);
&.md-direction-bottom-right {
@@ -64,8 +64,8 @@ $menu-base-width: 56px;
opacity: 1;
clip-path: inset(-8px -8px -8px -8px);
transition: width $swift-ease-out-duration $swift-ease-out-timing-function,
- opacity .3s $swift-ease-out-timing-function,
- clip-path .2s .073s $swift-ease-out-timing-function;
+ opacity .4s $swift-ease-out-timing-function,
+ clip-path .27s .08s $swift-ease-out-timing-function;
}
}
diff --git a/src/components/mdMenu/mdMenu.vue b/src/components/mdMenu/mdMenu.vue
index 93ac278..8330c2b 100644
--- a/src/components/mdMenu/mdMenu.vue
+++ b/src/components/mdMenu/mdMenu.vue
@@ -18,6 +18,10 @@
mdDirection: {
type: String,
default: 'bottom right'
+ },
+ mdCloseOnSelect: {
+ type: Boolean,
+ default: true
}
},
data() {
@@ -176,11 +180,11 @@
window.requestAnimationFrame(this.calculateMenuContentPos);
},
open() {
- if (document.body.contains(this.menuContent)) {
- document.body.removeChild(this.menuContent);
+ if (this.$root.$el.contains(this.menuContent)) {
+ this.$root.$el.removeChild(this.menuContent);
}
- document.body.appendChild(this.menuContent);
+ this.$root.$el.appendChild(this.menuContent);
document.addEventListener('click', this.closeOnOffClick);
window.addEventListener('resize', this.recalculateOnResize);
@@ -205,7 +209,7 @@
activeRipple.classList.remove('md-active');
}
- document.body.removeChild(menuContent);
+ this.$root.$el.removeChild(menuContent);
document.removeEventListener('click', this.closeOnOffClick);
window.removeEventListener('resize', this.recalculateOnResize);
}
diff --git a/src/components/mdMenu/mdMenuItem.vue b/src/components/mdMenu/mdMenuItem.vue
index 2f2d334..0080990 100644
--- a/src/components/mdMenu/mdMenuItem.vue
+++ b/src/components/mdMenu/mdMenuItem.vue
@@ -9,54 +9,70 @@
diff --git a/src/components/mdSelect/mdOption.vue b/src/components/mdSelect/mdOption.vue
index 0e9b925..88f91bb 100644
--- a/src/components/mdSelect/mdOption.vue
+++ b/src/components/mdSelect/mdOption.vue
@@ -1,73 +1,73 @@
-
-
+
+
+
+
+
+
+
-
+
diff --git a/src/components/mdSelect/mdSelect.scss b/src/components/mdSelect/mdSelect.scss
index a806996..c713fd6 100644
--- a/src/components/mdSelect/mdSelect.scss
+++ b/src/components/mdSelect/mdSelect.scss
@@ -46,6 +46,13 @@
left: -999em;
}
+ .md-menu {
+ width: 100%;
+ height: 100%;
+ display: block;
+ position: relative;
+ }
+
.md-select-value {
width: 100%;
height: 100%;
@@ -65,7 +72,6 @@
min-width: 156px;
max-width: 100%;
min-height: 48px;
- max-height: 256px;
display: flex;
flex-flow: column;
justify-content: stretch;
@@ -113,30 +119,42 @@
}
}
-.md-option {
- height: 48px;
- min-height: 48px;
- padding: 0 4px 0 16px;
- display: flex;
- flex-flow: column;
- justify-content: center;
- overflow: hidden;
- cursor: pointer;
- position: relative;
- transform: translate3D(0, 0, 0);
- transition: $swift-ease-out;
- font-size: 16px;
- line-height: 1.2em;
- text-overflow: ellipsis;
- white-space: nowrap;
+.md-select-content {
+ width: auto;
+ max-height: 256px;
- &.md-highlighted {
- background-color: rgba(#000, .12);
+ &.md-direction-bottom-right {
+ margin-top: -15px;
+ margin-left: -16px;
}
- span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ &.md-direction-bottom-left {
+ margin-top: -15px;
+ margin-left: 16px;
+ }
+
+ &.md-direction-top-right {
+ margin-top: 15px;
+ margin-left: -16px;
+ }
+
+ &.md-direction-top-left {
+ margin-top: 15px;
+ margin-left: 16px;
+ }
+
+ .md-menu-item .md-list-item-holder {
+ overflow: visible;
+ justify-content: flex-start;
+ }
+
+ &.md-multiple {
+ .md-checkbox {
+ margin: 0;
+ }
+
+ .md-checkbox-label {
+ padding-left: 16px;
+ }
}
}
diff --git a/src/components/mdSelect/mdSelect.vue b/src/components/mdSelect/mdSelect.vue
index df20bea..a19e6bd 100644
--- a/src/components/mdSelect/mdSelect.vue
+++ b/src/components/mdSelect/mdSelect.vue
@@ -1,26 +1,12 @@
-
-
{{ value }}
+
+
+ {{ selectedValue || multiplevalue }}
-
+
+