-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,018 additions
and
25 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module.exports = { | ||
presets: ['@vue/cli-plugin-babel/preset'], | ||
plugins: ['@babel/plugin-transform-private-methods'], | ||
}; |
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
Binary file not shown.
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
36 changes: 36 additions & 0 deletions
36
packages/ketchup-showcase/src/views/components/basic/pdf/Pdf.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div> | ||
<comp :giturl="giturl" :headtitle="headtitle" :titles="titles"> | ||
<template v-slot:0> | ||
<pdf-demo></pdf-demo> | ||
</template> | ||
<template v-slot:1> | ||
<pdf-basic></pdf-basic> | ||
</template> | ||
</comp> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Comp from '@/views/templates/Comp'; | ||
import PdfDemo from './examples/PdfDemo'; | ||
import PdfBasic from './examples/PdfBasic'; | ||
export default { | ||
components: { | ||
PdfDemo, | ||
PdfBasic, | ||
Comp, | ||
}, | ||
data() { | ||
return { | ||
giturl: | ||
'https://github.com/smeup/ketchup/tree/develop/packages/ketchup/src/components/kup-pdf', | ||
headtitle: 'Pdf', | ||
titles: ['Playground', 'Basic Usage'], | ||
}; | ||
}, | ||
title: 'Ketchup | Pdf', | ||
}; | ||
</script> |
25 changes: 25 additions & 0 deletions
25
packages/ketchup-showcase/src/views/components/basic/pdf/examples/PdfBasic.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div> | ||
<div class="demo-wrapper"> | ||
<p | ||
>The Pdf component provides a streamlined solution for viewing Pdf | ||
documents.</p | ||
> | ||
<div class="demo-container"> | ||
<p class="centered">Sample markup</p> | ||
<code class="flat">{{ markupBasic }}</code> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'PdfBasic', | ||
data() { | ||
return { | ||
markupBasic: '<kup-pdf></kup-pdf>', | ||
}; | ||
}, | ||
}; | ||
</script> |
64 changes: 64 additions & 0 deletions
64
packages/ketchup-showcase/src/views/components/basic/pdf/examples/PdfDemo.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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div> | ||
<demo | ||
:demoComp="demoComp" | ||
:demoEvents="demoEvents" | ||
:demoMethods="demoMethods" | ||
:demoProps="demoProps" | ||
></demo> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Demo from '@/views/templates/Demo'; | ||
export default { | ||
components: { | ||
Demo, | ||
}, | ||
name: 'PdfDemo', | ||
data() { | ||
return { | ||
demoComp: createComp(), | ||
demoEvents: [ | ||
{ | ||
name: 'kup-pdf-ready', | ||
type: 'CustomEvent', | ||
}, | ||
], | ||
demoMethods: [ | ||
{ | ||
name: 'getProps', | ||
description: | ||
"Returns the props' values of the component. When invoked giving true as the only argument, returns the props descriptions instead.", | ||
}, | ||
{ | ||
name: 'refresh', | ||
description: | ||
'This method is used to trigger a new render of the component.', | ||
}, | ||
{ | ||
name: 'setProps', | ||
description: 'Sets the props to the component.', | ||
}, | ||
], | ||
demoProps: [ | ||
{ | ||
prop: 'pdfPath', | ||
description: 'The path to the PDF file.', | ||
type: 'string', | ||
default: '""', | ||
try: 'field', | ||
}, | ||
], | ||
}; | ||
}, | ||
}; | ||
function createComp() { | ||
const comp = document.createElement('kup-pdf'); | ||
comp.id = 'demo-component'; | ||
comp.pdfPath = '/assets/kup-pdf-sample.pdf'; | ||
return comp; | ||
} | ||
</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
Binary file not shown.
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,15 @@ | ||
const comp = document.getElementById('pdf'); | ||
|
||
comp.addEventListener('kup-pdf-ready', (e) => { | ||
console.log('Pdf ready', e); | ||
}); | ||
|
||
const props = { | ||
pdfPath: '../../assets/kup-pdf-sample.pdf', | ||
}; | ||
|
||
if (props) { | ||
for (const key in props) { | ||
comp[key] = props[key]; | ||
} | ||
} |
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.