Timeline PT demo added

pull/3946/head
Tuğçe Küçükoğlu 2023-05-10 10:29:49 +03:00
parent 5f889d2037
commit 15131bf13b
4 changed files with 154 additions and 2 deletions

101
doc/timeline/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,101 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card">
<Timeline
:value="events"
:pt="{
marker: { class: 'border-orange-400' }
}"
>
<template #content="slotProps">
{{ slotProps.item.status }}
</template>
</Timeline>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
events: [
{ status: 'Ordered', date: '15/10/2020 10:30', icon: 'pi pi-shopping-cart', color: '#9C27B0' },
{ status: 'Processing', date: '15/10/2020 14:00', icon: 'pi pi-cog', color: '#673AB7' },
{ status: 'Shipped', date: '15/10/2020 16:15', icon: 'pi pi-shopping-cart', color: '#FF9800' },
{ status: 'Delivered', date: '16/10/2020 10:00', icon: 'pi pi-check', color: '#607D8B' }
],
code: {
basic: `
<Timeline
:value="events"
:pt="{
marker: { class: 'border-orange-400' }
}"
>
<template #content="slotProps">
{{ slotProps.item.status }}
</template>
</Timeline>`,
options: `
<template>
<div class="card">
<Timeline
:value="events"
:pt="{
marker: { class: 'border-orange-400' }
}"
>
<template #content="slotProps">
{{ slotProps.item.status }}
</template>
</Timeline>
</div>
</template>
<script>
export default {
data() {
return {
events: [
{ status: 'Ordered', date: '15/10/2020 10:30', icon: 'pi pi-shopping-cart', color: '#9C27B0'},
{ status: 'Processing', date: '15/10/2020 14:00', icon: 'pi pi-cog', color: '#673AB7' },
{ status: 'Shipped', date: '15/10/2020 16:15', icon: 'pi pi-shopping-cart', color: '#FF9800' },
{ status: 'Delivered', date: '16/10/2020 10:00', icon: 'pi pi-check', color: '#607D8B' }
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card">
<Timeline
:value="events"
:pt="{
marker: { class: 'border-orange-400' }
}"
>
<template #content="slotProps">
{{ slotProps.item.status }}
</template>
</Timeline>
</div>
</template>
<script setup>
import { ref } from "vue";
const events = ref([
{ status: 'Ordered', date: '15/10/2020 10:30', icon: 'pi pi-shopping-cart', color: '#9C27B0'},
{ status: 'Processing', date: '15/10/2020 14:00', icon: 'pi pi-cog', color: '#673AB7' },
{ status: 'Shipped', date: '15/10/2020 16:15', icon: 'pi pi-shopping-cart', color: '#FF9800' },
{ status: 'Delivered', date: '16/10/2020 10:00', icon: 'pi pi-check', color: '#607D8B' }
]);
<\/script>`
}
};
}
};
</script>

View File

@ -0,0 +1,8 @@
<template>
<DocSectionText v-bind="$attrs">
<p>{{ $attrs.description }}</p>
</DocSectionText>
<div class="card">
<img class="w-full" src="https://primefaces.org/cdn/primevue/images/pt/wireframe-placeholder.jpg" />
</div>
</template>

41
doc/timeline/pt/index.vue Normal file
View File

@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Timeline Pass Through</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import DocApiTable from '@/components/doc/DocApiTable.vue';
import { getPTOption } from '@/components/doc/helpers/PTHelper.js';
import PtDoc from './PTDoc.vue';
import PTImage from './PTImage.vue';
export default {
data() {
return {
docs: [
{
id: 'pt.image',
label: 'Wireframe',
component: PTImage
},
{
id: 'pt.doc.timeline',
label: 'Timeline PT Options',
component: DocApiTable,
data: getPTOption('Timeline')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Timeline Component" header="Timeline" description="Timeline visualizes a series of chained events." :componentDocs="docs" :apiDocs="['Timeline']" />
<DocComponent title="Vue Timeline Component" header="Timeline" description="Timeline visualizes a series of chained events." :componentDocs="docs" :apiDocs="['Timeline']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -11,6 +11,7 @@ import ImportDoc from '@/doc/timeline/ImportDoc';
import OppositeDoc from '@/doc/timeline/OppositeDoc';
import StyleDoc from '@/doc/timeline/StyleDoc';
import TemplateDoc from '@/doc/timeline/TemplateDoc';
import PTComponent from '@/doc/timeline/pt/index.vue';
export default {
data() {
@ -56,7 +57,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};