This repository has been archived by the owner on Nov 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from pocka/feature/kebab-case
Add case conversion option
- Loading branch information
Showing
17 changed files
with
379 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script> | ||
export default { | ||
props: { | ||
tooLongCamelProps: { | ||
type: String, | ||
default: 'foo' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<p>camelCase</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import CamelComponent from './camel.vue' | ||
import KebabComponent from './kebab.vue' | ||
import MixedComponent from './mixed.vue' | ||
|
||
export default { | ||
title: 'Issues/#122' | ||
} | ||
|
||
export const camelToKebab = () => { | ||
return { | ||
components: { CamelComponent }, | ||
template: '<CamelComponent />' | ||
} | ||
} | ||
camelToKebab.story = { | ||
title: 'Convert camelCase to kebab-case', | ||
parameters: { | ||
info: { | ||
casing: 'kebab' | ||
} | ||
} | ||
} | ||
|
||
export const kebabToCamel = () => { | ||
return { | ||
components: { KebabComponent }, | ||
template: '<kebab-component />' | ||
} | ||
} | ||
kebabToCamel.story = { | ||
title: 'Convert kebab-case to camelCase', | ||
parameters: { | ||
info: { | ||
casing: 'camel' | ||
} | ||
} | ||
} | ||
|
||
export const mixedToKebab = () => { | ||
return { | ||
components: { MixedComponent }, | ||
template: '<mixed-component/>' | ||
} | ||
} | ||
mixedToKebab.story = { | ||
title: 'Convert to kebab-case (mixed)', | ||
parameters: { | ||
info: { | ||
casing: 'kebab' | ||
} | ||
} | ||
} | ||
|
||
export const mixedToCamel = () => { | ||
return { | ||
components: { MixedComponent }, | ||
template: '<mixed-component/>' | ||
} | ||
} | ||
mixedToCamel.story = { | ||
title: 'Convert to camelCase (mixed)', | ||
parameters: { | ||
info: { | ||
casing: 'camel' | ||
} | ||
} | ||
} | ||
|
||
export const preserve = () => { | ||
return { | ||
components: { MixedComponent }, | ||
template: '<mixed-component/>' | ||
} | ||
} | ||
preserve.story = { | ||
title: 'Preserve casing when undefined', | ||
parameters: { | ||
info: {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script> | ||
export default { | ||
props: { | ||
'too-long-kebab-props': { | ||
type: String, | ||
default: 'foo' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<p>kebab-case</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script> | ||
export default { | ||
props: { | ||
tooLongCamelProps: { | ||
type: String, | ||
default: 'foo' | ||
}, | ||
'too-long-kebab-props': { | ||
type: String, | ||
default: 'foo' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<p>mIxeD-CaSE</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ const commonConfig = { | |
}) | ||
], | ||
external: [ | ||
'change-case', | ||
'vue', | ||
'dedent', | ||
'marked', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.