From 3babdb8da4108df4d3664b2c029299a967518d9c Mon Sep 17 00:00:00 2001 From: Paulo dos Santos Date: Wed, 2 Nov 2016 21:30:15 -0200 Subject: [PATCH 1/3] Fix for issue #41 (md-button ignoring type prop) --- src/components/mdButton/mdButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/mdButton/mdButton.vue b/src/components/mdButton/mdButton.vue index bea67d5..991edb6 100644 --- a/src/components/mdButton/mdButton.vue +++ b/src/components/mdButton/mdButton.vue @@ -14,7 +14,7 @@ let options = { staticClass: 'md-button', attrs: { - type: hasLink || 'button', + type: this.type || 'button', disabled: isDisabled }, directives: [{ From 18da74e939637404364a7897ef6739a2b1f9a3ed Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Sat, 12 Nov 2016 14:00:15 -0200 Subject: [PATCH 2/3] Make md-select with md-menu --- docs/src/pages/components/Select.vue | 87 ++++++++++--------- src/components/mdButton/mdButton.scss | 1 + .../mdInputContainer/mdInputContainer.vue | 28 +++--- src/components/mdMenu/mdMenu.scss | 6 +- src/components/mdMenu/mdMenuItem.vue | 56 +++++++----- src/components/mdSelect/mdOption.vue | 58 ++++--------- src/components/mdSelect/mdSelect.scss | 48 +++++----- src/components/mdSelect/mdSelect.vue | 86 +++++------------- src/core/utils/getClosestVueParent.js | 17 ++++ 9 files changed, 178 insertions(+), 209 deletions(-) create mode 100644 src/core/utils/getClosestVueParent.js diff --git a/docs/src/pages/components/Select.vue b/docs/src/pages/components/Select.vue index efcc040..adcaa44 100644 --- a/docs/src/pages/components/Select.vue +++ b/docs/src/pages/components/Select.vue @@ -6,47 +6,49 @@ - Fight Club - Godfather II - Godfather III - Godfather - Godfellas - Pulp Fiction - Scarface + Fight Club + Godfather + Godfather II + Godfather III + Godfellas + Pulp Fiction + Scarface - Australia - Brazil - Japan - United States + Australia + Brazil + Japan + United States - Arial - Calibri - Cambria - Comic Sans - Consolas - Courier - Droid Sans - Georgia - Helvetica - Impact - Roboto - Segoe UI - Times New Roman - Ubuntu - Verdana + Arial + Calibri + Cambria + Comic Sans + Consolas + Courier + Droid Sans + Georgia + Helvetica + Impact + Roboto + Segoe UI + Times New Roman + Ubuntu + Verdana + + Set Pulp Fiction @@ -55,18 +57,18 @@ Fruits - Apples - Bananas - Peaches - Oranges + Apples + Bananas + Peaches + Oranges Vegetables - Carrots - Cucumbers + Carrots + Cucumbers Baked Goods - Apple Pie - Chocolate Cake + Apple Pie + Chocolate Cake @@ -168,13 +170,16 @@ diff --git a/src/components/mdButton/mdButton.scss b/src/components/mdButton/mdButton.scss index df8745e..9cc6848 100644 --- a/src/components/mdButton/mdButton.scss +++ b/src/components/mdButton/mdButton.scss @@ -32,6 +32,7 @@ $button-icon-size: 40px; font-style: inherit; font-variant: inherit; font-weight: 500; + letter-spacing: inherit; line-height: $button-height; text-align: center; text-transform: uppercase; diff --git a/src/components/mdInputContainer/mdInputContainer.vue b/src/components/mdInputContainer/mdInputContainer.vue index a997995..336bcd1 100644 --- a/src/components/mdInputContainer/mdInputContainer.vue +++ b/src/components/mdInputContainer/mdInputContainer.vue @@ -19,6 +19,18 @@ mdDisabled: Boolean, mdHasPassword: Boolean }, + data() { + return { + value: '', + input: false, + inputType: false, + showPassword: false, + enableCounter: false, + mdHasSelect: false, + counterLength: 0, + inputLength: 0 + }; + }, computed: { classes() { return { @@ -29,24 +41,10 @@ }; } }, - data() { - return { - value: null, - input: false, - inputType: false, - showPassword: false, - enableCounter: false, - mdHasSelect: false, - counterLength: 0, - inputLength: 0 - }; - }, 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/mdMenuItem.vue b/src/components/mdMenu/mdMenuItem.vue index 2f2d334..08f28eb 100644 --- a/src/components/mdMenu/mdMenuItem.vue +++ b/src/components/mdMenu/mdMenuItem.vue @@ -9,54 +9,66 @@ diff --git a/src/components/mdSelect/mdOption.vue b/src/components/mdSelect/mdOption.vue index 0e9b925..3512229 100644 --- a/src/components/mdSelect/mdOption.vue +++ b/src/components/mdSelect/mdOption.vue @@ -1,20 +1,16 @@ diff --git a/src/components/mdSelect/mdSelect.scss b/src/components/mdSelect/mdSelect.scss index a806996..f72e66c 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,26 @@ } } -.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 { + 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; } } diff --git a/src/components/mdSelect/mdSelect.vue b/src/components/mdSelect/mdSelect.vue index df20bea..af37d74 100644 --- a/src/components/mdSelect/mdSelect.vue +++ b/src/components/mdSelect/mdSelect.vue @@ -1,26 +1,12 @@