Galleria pt demo added

pull/3925/head
Tuğçe Küçükoğlu 2023-05-04 11:34:08 +03:00
parent eab81766e0
commit d75a54bd23
4 changed files with 231 additions and 8 deletions

172
doc/galleria/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,172 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card md:flex md:justify-content-center">
<Galleria
:value="images"
:responsiveOptions="responsiveOptions"
:numVisible="5"
:pt="{
root: { style: { maxWidth: '640px' } }
}"
>
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
</div>
<DocSectionCode :code="code" :service="['PhotoService']" />
</template>
<script>
import { PhotoService } from '@/service/PhotoService';
export default {
data() {
return {
images: null,
responsiveOptions: [
{
breakpoint: '991px',
numVisible: 4
},
{
breakpoint: '767px',
numVisible: 3
},
{
breakpoint: '575px',
numVisible: 1
}
],
code: {
basic: `
<Galleria
:value="images"
:responsiveOptions="responsiveOptions"
:numVisible="5"
:pt="{
root: { style: { maxWidth: '640px' } }
}"
>
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>`,
options: `
<template>
<div class="card md:flex md:justify-content-center">
<Galleria
:value="images"
:responsiveOptions="responsiveOptions"
:numVisible="5"
:pt="{
root: { style: { maxWidth: '640px' } }
}"
>
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
</div>
</template>
<script>
import { PhotoService } from '@/service/PhotoService';
export default {
data() {
return {
images: null,
responsiveOptions: [
{
breakpoint: '991px',
numVisible: 4
},
{
breakpoint: '767px',
numVisible: 3
},
{
breakpoint: '575px',
numVisible: 1
}
]
};
},
mounted() {
PhotoService.getImages().then((data) => (this.images = data));
}
};
<\/script>`,
composition: `
<template>
<div class="card md:flex md:justify-content-center">
<Galleria
:value="images"
:responsiveOptions="responsiveOptions"
:numVisible="5"
:pt="{
root: { style: { maxWidth: '640px' } }
}"
>
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { PhotoService } from '@/service/PhotoService';
onMounted(() => {
PhotoService.getImages().then((data) => (images.value = data));
});
const images = ref();
const responsiveOptions = ref([
{
breakpoint: '991px',
numVisible: 4
},
{
breakpoint: '767px',
numVisible: 3
},
{
breakpoint: '575px',
numVisible: 1
}
]);
<\/script>`,
data: `
/* PhotoService */
{
itemImageSrc: 'https://primefaces.org/cdn/primevue/images/galleria/galleria1.jpg',
thumbnailImageSrc: 'https://primefaces.org/cdn/primevue/images/galleria/galleria1s.jpg',
alt: 'Description for Image 1',
title: 'Title 1'
},
...
`
}
};
},
mounted() {
PhotoService.getImages().then((data) => (this.images = data));
}
};
</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/galleria/pt/index.vue Normal file
View File

@ -0,0 +1,41 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Galleria 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.galleria',
label: 'Galleria PT Options',
component: DocApiTable,
data: getPTOption('Galleria')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Gallery Component" header="Galleria" description="Galleria is a content gallery component." :componentDocs="docs" :apiDocs="['Galleria']" />
<DocComponent title="Vue Gallery Component" header="Galleria" description="Galleria is a content gallery component." :componentDocs="docs" :apiDocs="['Galleria']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -9,10 +9,13 @@ import AutoPlayDoc from '@/doc/galleria/AutoPlayDoc';
import BasicDoc from '@/doc/galleria/BasicDoc';
import CaptionDoc from '@/doc/galleria/CaptionDoc';
import ControlledDoc from '@/doc/galleria/ControlledDoc';
import CustomContentDoc from '@/doc/galleria/fullscreen/CustomContentDoc';
import WithoutThumbnailsDoc from '@/doc/galleria/fullscreen/WithoutThumbnailsDoc';
import WithThumbnailsDoc from '@/doc/galleria/fullscreen/WithThumbnailsDoc';
import ImportDoc from '@/doc/galleria/ImportDoc';
import ResponsiveDoc from '@/doc/galleria/ResponsiveDoc';
import StyleDoc from '@/doc/galleria/StyleDoc';
import ThumbnailDoc from '@/doc/galleria/ThumbnailDoc';
import CustomContentDoc from '@/doc/galleria/fullscreen/CustomContentDoc';
import WithThumbnailsDoc from '@/doc/galleria/fullscreen/WithThumbnailsDoc';
import WithoutThumbnailsDoc from '@/doc/galleria/fullscreen/WithoutThumbnailsDoc';
import ClickEventDoc from '@/doc/galleria/indicator/ClickEventDoc';
import HoverEventDoc from '@/doc/galleria/indicator/HoverEventDoc';
import PositionDoc from '@/doc/galleria/indicator/PositionDoc';
@ -21,9 +24,7 @@ import HoverDoc from '@/doc/galleria/navigator/HoverDoc';
import IndicatorsDoc from '@/doc/galleria/navigator/IndicatorsDoc';
import ItemThumbnailsDoc from '@/doc/galleria/navigator/ItemThumbnailsDoc';
import ItemWithoutThumbnailsDoc from '@/doc/galleria/navigator/ItemWithoutThumbnailsDoc';
import ResponsiveDoc from '@/doc/galleria/ResponsiveDoc';
import StyleDoc from '@/doc/galleria/StyleDoc';
import ThumbnailDoc from '@/doc/galleria/ThumbnailDoc';
import PTComponent from '@/doc/galleria/pt/index.vue';
export default {
data() {
@ -155,7 +156,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};