FileUpload, OverlayPanel, Sidebar unstyled demo updates

pull/4224/head
Tuğçe Küçükoğlu 2023-07-27 12:42:08 +03:00
parent d515205ca8
commit 46784087c7
12 changed files with 249 additions and 22 deletions

View File

@ -0,0 +1,37 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
</DocSectionText>
<DocSectionCode :code="code" embedded />
</template>
<script>
export default {
data() {
return {
code: {
composition: `
<template>
<div class="card">
<Toast />
<FileUpload name="demo[]" url="./upload.php" @upload="onAdvancedUpload($event)" :multiple="true" accept="image/*" :maxFileSize="1000000">
<template #empty>
<p>Drag and drop files to here to upload.</p>
</template>
</FileUpload>
</div>
</template>
<script setup>
import { useToast } from "primevue/usetoast";
const toast = useToast();
const onAdvancedUpload = () => {
toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
};
<\/script>`
}
};
}
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>FileUpload Theming</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import StyledDoc from './StyledDoc.vue';
import UnstyledDoc from './UnstyledDoc.vue';
export default {
data() {
return {
docs: [
{
id: 'styled',
label: 'Styled',
component: StyledDoc
},
{
id: 'unstyled',
label: 'Unstyled',
component: UnstyledDoc
}
]
};
}
};
</script>

View File

@ -0,0 +1,36 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
</DocSectionText>
<DocSectionCode :code="code" embedded />
</template>
<script>
export default {
data() {
return {
code: {
composition: `
<template>
<div class="card flex justify-center">
<Button type="button" icon="pi pi-image" label="Image" @click="toggle" />
<OverlayPanel ref="op">
<img src="https://primefaces.org/cdn/primevue/images/product/bamboo-watch.jpg" alt="Bamboo Watch" />
</OverlayPanel>
</div>
</template>
<script setup>
import { ref } from "vue";
const op = ref();
const toggle = (event) => {
op.value.toggle(event);
}
<\/script>`
}
};
}
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>OverlayPanel Theming</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import StyledDoc from './StyledDoc.vue';
import UnstyledDoc from './UnstyledDoc.vue';
export default {
data() {
return {
docs: [
{
id: 'styled',
label: 'Styled',
component: StyledDoc
},
{
id: 'unstyled',
label: 'Unstyled',
component: UnstyledDoc
}
]
};
}
};
</script>

View File

@ -0,0 +1,57 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
</DocSectionText>
<DocSectionCode :code="code" embedded />
</template>
<script>
export default {
data() {
return {
code: {
composition: `
<template>
<div class="card">
<div class="flex gap-2 justify-content-center">
<Button icon="pi pi-arrow-right" @click="visibleLeft = true" />
<Button icon="pi pi-arrow-left" @click="visibleRight = true" />
<Button icon="pi pi-arrow-down" @click="visibleTop = true" />
<Button icon="pi pi-arrow-up" @click="visibleBottom = true" />
</div>
<Sidebar v-model:visible="visibleLeft">
<h2>Left Sidebar</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</Sidebar>
<Sidebar v-model:visible="visibleRight" position="right">
<h2>Right Sidebar</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</Sidebar>
<Sidebar v-model:visible="visibleTop" position="top">
<h2>Top Sidebar</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</Sidebar>
<Sidebar v-model:visible="visibleBottom" position="bottom">
<h2>Bottom Sidebar</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</Sidebar>
</div>
</template>
<script setup>
import { ref } from "vue";
const visibleLeft = ref(false);
const visibleRight = ref(false);
const visibleTop = ref(false);
const visibleBottom = ref(false);
<\/script>`
}
};
}
};
</script>

View File

@ -0,0 +1,33 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>Sidebar Theming</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import StyledDoc from './StyledDoc.vue';
import UnstyledDoc from './UnstyledDoc.vue';
export default {
data() {
return {
docs: [
{
id: 'styled',
label: 'Styled',
component: StyledDoc
},
{
id: 'unstyled',
label: 'Unstyled',
component: UnstyledDoc
}
]
};
}
};
</script>

View File

@ -6,6 +6,7 @@
:componentDocs="docs"
:apiDocs="['FileUpload']"
:ptTabComponent="ptComponent"
:themingDocs="themingDoc"
/>
</template>
@ -16,9 +17,9 @@ import AutoDoc from '@/doc/fileupload/AutoDoc.vue';
import BasicDoc from '@/doc/fileupload/BasicDoc.vue';
import CustomUploadDoc from '@/doc/fileupload/CustomUploadDoc.vue';
import ImportDoc from '@/doc/fileupload/ImportDoc.vue';
import StyleDoc from '@/doc/fileupload/StyleDoc.vue';
import TemplateDoc from '@/doc/fileupload/TemplateDoc.vue';
import PTComponent from '@/doc/fileupload/pt/index.vue';
import ThemingDoc from '@/doc/fileupload/theming/index.vue';
export default {
data() {
@ -54,18 +55,14 @@ export default {
label: 'Custom Upload',
component: CustomUploadDoc
},
{
id: 'style',
label: 'Style',
component: StyleDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
],
ptComponent: PTComponent
ptComponent: PTComponent,
themingDoc: ThemingDoc
};
}
};

View File

@ -6,6 +6,7 @@
:componentDocs="docs"
:apiDocs="['OverlayPanel']"
:ptTabComponent="ptComponent"
:themingDocs="themingDoc"
/>
</template>
@ -14,8 +15,8 @@ import AccessibilityDoc from '@/doc/overlaypanel/AccessibilityDoc';
import BasicDoc from '@/doc/overlaypanel/BasicDoc';
import DataTableDoc from '@/doc/overlaypanel/DataTableDoc';
import ImportDoc from '@/doc/overlaypanel/ImportDoc';
import StyleDoc from '@/doc/overlaypanel/StyleDoc';
import PTComponent from '@/doc/overlaypanel/pt/index.vue';
import ThemingDoc from '@/doc/overlaypanel/theming/index.vue';
export default {
data() {
@ -36,18 +37,14 @@ export default {
label: 'DataTable',
component: DataTableDoc
},
{
id: 'style',
label: 'Style',
component: StyleDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
],
ptComponent: PTComponent
ptComponent: PTComponent,
themingDoc: ThemingDoc
};
}
};

View File

@ -1,5 +1,13 @@
<template>
<DocComponent title="Vue Sidebar Component" header="Sidebar" description="Sidebar, also known as Drawer, is a container component displayed as an overlay." :componentDocs="docs" :apiDocs="['Sidebar']" :ptTabComponent="ptComponent" />
<DocComponent
title="Vue Sidebar Component"
header="Sidebar"
description="Sidebar, also known as Drawer, is a container component displayed as an overlay."
:componentDocs="docs"
:apiDocs="['Sidebar']"
:ptTabComponent="ptComponent"
:themingDocs="themingDoc"
/>
</template>
<script>
@ -9,9 +17,9 @@ import FullScreenDoc from '@/doc/sidebar/FullScreenDoc';
import ImportDoc from '@/doc/sidebar/ImportDoc';
import PositionDoc from '@/doc/sidebar/PositionDoc';
import SizeDoc from '@/doc/sidebar/SizeDoc';
import StyleDoc from '@/doc/sidebar/StyleDoc';
import TemplateDoc from '@/doc/sidebar/TemplateDoc';
import PTComponent from '@/doc/sidebar/pt/index.vue';
import ThemingDoc from '@/doc/sidebar/theming/index.vue';
export default {
data() {
@ -47,18 +55,14 @@ export default {
label: 'Template',
component: TemplateDoc
},
{
id: 'style',
label: 'Style',
component: StyleDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
],
ptComponent: PTComponent
ptComponent: PTComponent,
themingDoc: ThemingDoc
};
}
};