-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#296): removed functional components
- Loading branch information
Showing
20 changed files
with
196 additions
and
215 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 was deleted.
Oops, something went wrong.
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,23 @@ | ||
<template> | ||
<pre :style="{ overflowX: 'scroll' }"> | ||
<code | ||
:style="{ | ||
fontSize: '12px', | ||
fontFamily: 'SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace' | ||
}" | ||
> | ||
{{ content }} | ||
</code> | ||
</pre> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'T3CeDefault', | ||
computed: { | ||
content () { | ||
return JSON.stringify(this.$attrs, null, 2) | ||
} | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './T3CeDefault.js' | ||
export { default } from './T3CeDefault.vue' |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<template functional> | ||
<template> | ||
<hr class="t3-ce-div"> | ||
</template> | ||
<script> | ||
export default { | ||
name: 'T3CeDiv', | ||
functional: true | ||
name: 'T3CeDiv' | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1,41 +1,40 @@ | ||
<template> | ||
<ul> | ||
<li | ||
v-for="child in children" | ||
:key="child.id" | ||
> | ||
<t3-nav-link | ||
:to="child.link" | ||
:attrs="{ | ||
target: child.target || false, | ||
title: child.title | ||
}" | ||
> | ||
{{ child.title }} | ||
</t3-nav-link> | ||
<T3CeMenuPagesList | ||
v-if="child.children" | ||
:children="child.children" | ||
/> | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<script> | ||
import T3CeMenuPagesList from './T3CeMenuPagesList.vue' | ||
// helper component to render nested list | ||
export default { | ||
functional: true, | ||
name: 'T3CeMenuPagesList', | ||
components: { | ||
T3CeMenuPagesList | ||
}, | ||
props: { | ||
children: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
render (createElement, ctx) { | ||
return createElement( | ||
'ul', | ||
ctx.props.children.map((el) => { | ||
return createElement('li', {}, [ | ||
createElement( | ||
'nav-link', | ||
{ | ||
props: { | ||
to: el.link | ||
}, | ||
attrs: { | ||
target: el.target || false, | ||
title: el.title | ||
} | ||
}, | ||
el.title | ||
), | ||
el.children | ||
? createElement('T3CeMenuPagesList', { | ||
props: { | ||
children: el.children | ||
} | ||
}) | ||
: false | ||
]) | ||
}) | ||
) | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
<template> | ||
<div> | ||
<T3Renderer :shortcut="shortcut" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'T3CeShortcut', | ||
functional: true, | ||
props: { | ||
shortcut: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
render (createElement, ctx) { | ||
return createElement('div', [ | ||
createElement('t3-ce-renderer', { | ||
props: { | ||
content: ctx.props.shortcut | ||
} | ||
}) | ||
]) | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1,43 +1,35 @@ | ||
<template> | ||
<div | ||
class="t3p-debug" | ||
:style="{ position: 'relative' }" | ||
> | ||
<code | ||
:style="{ | ||
width: '100%', | ||
border: '2px solid #E53E3E', | ||
color: '#000', | ||
display: 'inline-block', | ||
wordBreak: 'break-word', | ||
position: 'absolute', | ||
fontSize: '12px', | ||
fontFamily: | ||
'SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace', | ||
padding: '10px', | ||
boxSizing: 'border-box', | ||
top: 0, | ||
left: 0, | ||
backgroundColor: '#FED7D7' | ||
}" | ||
> | ||
{{ JSON.stringify($attrs) }} | ||
</code> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// you can use debug wrapper to display quickly CE data | ||
export default { | ||
name: 'T3Debug', | ||
functional: true, | ||
render (createElement, ctx) { | ||
return createElement( | ||
'div', | ||
{ | ||
style: { | ||
position: 'relative' | ||
}, | ||
class: 't3p-debug' | ||
}, | ||
[ | ||
createElement( | ||
'code', | ||
{ | ||
style: { | ||
width: '100%', | ||
border: '2px solid #E53E3E', | ||
color: '#000', | ||
display: 'inline-block', | ||
wordBreak: 'break-word', | ||
position: 'absolute', | ||
fontSize: '12px', | ||
fontFamily: | ||
'SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace', | ||
padding: '10px', | ||
boxSizing: 'border-box', | ||
top: 0, | ||
left: 0, | ||
backgroundColor: '#FED7D7' | ||
} | ||
}, | ||
JSON.stringify(ctx.props) | ||
), | ||
ctx.children | ||
] | ||
) | ||
} | ||
name: 'T3Debug' | ||
} | ||
</script> |
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
<template> | ||
<div | ||
class="t3-ce-frame" | ||
:class="computedClasses" | ||
v-bind="$attrs" | ||
> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<!-- Content element wrapper - Section Frame | ||
All props are returned from appearance --> | ||
<script> | ||
export default { | ||
name: 'T3Frame', | ||
props: { | ||
frameClass: { | ||
type: String, | ||
default: '' | ||
}, | ||
layout: { | ||
type: String, | ||
default: 'default' | ||
}, | ||
spaceAfter: { | ||
type: String, | ||
default: 'default' | ||
}, | ||
spaceBefore: { | ||
type: String, | ||
default: 'default' | ||
} | ||
}, | ||
computed: { | ||
computedClasses () { | ||
return [ | ||
`frame-${this.frameClass}`, | ||
`layout-${this.layout}`, | ||
`space-before-${ | ||
this.spaceBefore.length ? this.spaceBefore : 'default' | ||
}`, | ||
`space-after-${ | ||
this.spaceAfter.length ? this.spaceAfter : 'default' | ||
}` | ||
] | ||
} | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './T3Frame.js' | ||
export { default } from './T3Frame.vue' |
Oops, something went wrong.