This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(md-enhance): add CodeTabs and Tabs
- Loading branch information
1 parent
829c0d3
commit 81fcd85
Showing
17 changed files
with
1,889 additions
and
20 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
249 changes: 249 additions & 0 deletions
249
packages/md-enhance/__tests__/unit/__snapshots__/codeTabs.spec.ts.snap
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,249 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`code tabs > shoud render mutiple block 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]'> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud render mutiple block 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]'> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud render single block 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]'> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud render single block 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]'> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support active 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' :active=\\"0\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support active 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' :active=\\"0\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support active 3`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support active 4`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support id 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' tab-id=\\"event\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support id 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' tab-id=\\"event-id\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support id 3`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' tab-id=\\"id with space\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support id 4`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' tab-id=\\"id starts and having space in the end\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support value 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\",\\"value\\":\\"javascript\\"}]'> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support value 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\",\\"value\\":\\"javascript\\"}]' :active=\\"0\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support value 3`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\",\\"value\\":\\"js\\"},{\\"title\\":\\"ts\\",\\"value\\":\\"typescript\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > shoud support value 4`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\",\\"value\\":\\"javascript\\"},{\\"title\\":\\"ts\\",\\"value\\":\\"typescript\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > should ignore other items 1`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' :active=\\"0\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > should ignore other items 2`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"}]' :active=\\"0\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"> | ||
<pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > should ignore other items 3`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"><pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"><pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; | ||
exports[`code tabs > should ignore other items 4`] = ` | ||
"<CodeTabs :data='[{\\"title\\":\\"js\\"},{\\"title\\":\\"ts\\"}]' :active=\\"1\\"> | ||
<template v-slot:tab0=\\"{ title, value, isActive }\\"><pre><code class=\\"language-js\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
<template v-slot:tab1=\\"{ title, value, isActive }\\"><pre><code class=\\"language-ts\\">const a = 1; | ||
</code></pre> | ||
</template> | ||
</CodeTabs> | ||
" | ||
`; |
Oops, something went wrong.