Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MdRatio 3/2 to MdCardMedia #2244

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/components/MdCard/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/MdCard/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-material.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -4356,7 +4356,7 @@ exports.default = {
props: {
mdRatio: _extends({
type: String
}, (0, _MdPropValidator2.default)('md-ratio', ['16-9', '16/9', '16:9', '4-3', '4/3', '4:3', '1-1', '1/1', '1:1'])),
}, (0, _MdPropValidator2.default)('md-ratio', ['16-9', '16/9', '16:9', '4-3', '4/3', '4:3', '3-2', '3/2', '3:2', '1-1', '1/1', '1:1'])),
mdMedium: Boolean,
mdBig: Boolean
},
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-material.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-material.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/app/pages/Components/Card/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default {
{
name: 'md-ratio',
type: 'String',
description: 'Resizes or clip the image automatically based on the following options: 1:1 or 1/1, 4:3 or 4/3 and 16:9 or 16/9.',
description: 'Resizes or clip the image automatically based on the following options: 1:1 or 1/1, 3:2 or 3/2, 4:3 or 4/3 and 16:9 or 16/9.',
defaults: 'null'
},
{
Expand Down
21 changes: 21 additions & 0 deletions src/components/MdCard/MdCardMedia/MdCardMedia.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,27 @@ test('should render the card media with correct ratio', async () => {
expect(wrapper.hasClass('md-ratio-4-3')).toBe(true)
})

test('should render the card media with correct ratio', async () => {
const template = '<md-card-media md-ratio="3:2"></md-card-media>'
const wrapper = await mountTemplate(MdCardMedia, template, cardComponents)

expect(wrapper.hasClass('md-ratio-3-2')).toBe(true)
})

test('should render the card media with correct ratio', async () => {
const template = '<md-card-media md-ratio="3-2"></md-card-media>'
const wrapper = await mountTemplate(MdCardMedia, template, cardComponents)

expect(wrapper.hasClass('md-ratio-3-2')).toBe(true)
})

test('should render the card media with correct ratio', async () => {
const template = '<md-card-media md-ratio="3/2"></md-card-media>'
const wrapper = await mountTemplate(MdCardMedia, template, cardComponents)

expect(wrapper.hasClass('md-ratio-3-2')).toBe(true)
})

test('should render the card media with correct ratio', async () => {
const template = '<md-card-media md-ratio="1:1"></md-card-media>'
const wrapper = await mountTemplate(MdCardMedia, template, cardComponents)
Expand Down
6 changes: 6 additions & 0 deletions src/components/MdCard/MdCardMedia/MdCardMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
'4-3',
'4/3',
'4:3',
'3-2',
'3/2',
'3:2',
'1-1',
'1/1',
'1:1'
Expand Down Expand Up @@ -100,6 +103,9 @@
@include md-image-aspect-ratio(4, 3);
}

&.md-ratio-3-2 {
@include md-image-aspect-ratio(3, 2);
}
&.md-ratio-1-1 {
@include md-image-aspect-ratio(1, 1);
}
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4706,6 +4706,11 @@ gitconfiglocal@^1.0.0:
dependencies:
ini "^1.3.2"

github-buttons@^2.8.0:
version "2.11.1"
resolved "https://registry.yarnpkg.com/github-buttons/-/github-buttons-2.11.1.tgz#0c7f3dc825297fc44f8c7403bdd30ac68f733e17"
integrity sha512-RMPwA6Zqqxu/P5jXeW02zuuPaChztG4ASHTKrzSlHgWiFg0crQQTp2E1kBRCGV+/9Bo99ziU+ggmVptLhu8k6A==

github-release-cli@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/github-release-cli/-/github-release-cli-0.3.0.tgz#fcd8df4db3e41a76925e0b2842b456598e302e0a"
Expand Down Expand Up @@ -7655,6 +7660,11 @@ onetime@^2.0.0:
dependencies:
mimic-fn "^1.0.0"

opencollective-postinstall@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/opencollective/-/opencollective-1.0.3.tgz#aee6372bc28144583690c3ca8daecfc120dd0ef1"
Expand Down Expand Up @@ -10661,6 +10671,13 @@ vue-ga@^1.1.0:
resolved "https://registry.yarnpkg.com/vue-ga/-/vue-ga-1.1.0.tgz#366fea37afb953b5b115e56feb1005cc6bd1e20e"
integrity sha512-cnwIW75CwsqGZP62dFZt7e4/k9vhKsos3pJBBKkREXJ4bk2ePVgJiOeynhjvAtvyRzEmfsASfYMwzt0Dra/cng==

vue-github-button@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/vue-github-button/-/vue-github-button-1.2.0.tgz#5624a2807b16bdac61589f55503b8a492d2a9d5b"
integrity sha512-lvGrbQnHWX8bYovtBFz5uSgtbM+glXXQQq5VR79YDsZ+Fh5DBpLR+Ws5YLz9eSA+gNGi3xnXKjZDbUeQXOYh6A==
dependencies:
github-buttons "^2.8.0"

vue-github-buttons@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/vue-github-buttons/-/vue-github-buttons-3.1.0.tgz#eaea2ba0b7e0df5a7fd1c61ba37dabf7553dd79a"
Expand Down