2023-08-07 09:03:52 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>
|
|
|
|
PrimeVue offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the
|
2023-08-07 12:40:22 +00:00
|
|
|
<PrimeVueNuxtLink to="/tailwind">Tailwind Customization</PrimeVueNuxtLink> section for an example.
|
2023-08-07 09:03:52 +00:00
|
|
|
</p>
|
2023-09-22 12:54:14 +00:00
|
|
|
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz scrollable />
|
2023-08-16 13:58:31 +00:00
|
|
|
<p class="mt-4">A playground sample with the pre-built Tailwind theme.</p>
|
2023-08-07 09:03:52 +00:00
|
|
|
<DocSectionCode :code="code2" embedded />
|
|
|
|
</DocSectionText>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
code1: {
|
2023-10-15 09:38:39 +00:00
|
|
|
basic: `
|
|
|
|
export default {
|
2023-08-07 09:03:52 +00:00
|
|
|
dialog: {
|
|
|
|
root: ({ state }) => ({
|
|
|
|
class: [
|
|
|
|
'rounded-lg shadow-lg border-0',
|
2023-11-15 12:47:48 +00:00
|
|
|
'max-h-[90%] transform scale-100',
|
2023-08-07 09:03:52 +00:00
|
|
|
'm-0 w-[50vw]',
|
|
|
|
'dark:border dark:border-blue-900/40',
|
|
|
|
{
|
|
|
|
'transition-none transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': state.maximized
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
header: {
|
|
|
|
class: ['flex items-center justify-between shrink-0', 'bg-white text-gray-800 border-t-0 rounded-tl-lg rounded-tr-lg p-6', 'dark:bg-gray-900 dark:text-white/80']
|
|
|
|
},
|
2023-10-18 06:58:43 +00:00
|
|
|
headerTitle: {
|
|
|
|
class: 'font-bold text-lg'
|
|
|
|
},
|
|
|
|
headerIcons: {
|
|
|
|
class: 'flex items-center'
|
|
|
|
},
|
2023-08-07 09:03:52 +00:00
|
|
|
closeButton: {
|
|
|
|
class: [
|
|
|
|
'flex items-center justify-center overflow-hidden relative',
|
|
|
|
'w-8 h-8 text-gray-500 border-0 bg-transparent rounded-full transition duration-200 ease-in-out mr-2 last:mr-0',
|
|
|
|
'hover:text-gray-700 hover:border-transparent hover:bg-gray-200',
|
|
|
|
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]', // focus
|
|
|
|
'dark:hover:text-white/80 dark:hover:border-transparent dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]'
|
|
|
|
]
|
|
|
|
},
|
2023-10-18 06:58:43 +00:00
|
|
|
closeButtonIcon: {
|
|
|
|
class: 'w-4 h-4 inline-block'
|
|
|
|
},
|
|
|
|
content: ({ state, instance }) => ({
|
2023-08-07 09:03:52 +00:00
|
|
|
class: [
|
|
|
|
'overflow-y-auto',
|
|
|
|
'bg-white text-gray-700 px-6 pb-8 pt-0',
|
2023-10-18 06:58:43 +00:00
|
|
|
,
|
|
|
|
'dark:bg-gray-900 dark:text-white/80',
|
2023-08-07 09:03:52 +00:00
|
|
|
{
|
|
|
|
grow: state.maximized
|
2023-10-18 06:58:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'rounded-bl-lg rounded-br-lg': !instance.$slots.footer
|
2023-08-07 09:03:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
footer: {
|
2023-10-18 06:58:43 +00:00
|
|
|
class: ['flex gap-2 shrink-0 justify-end align-center', 'border-t-0 bg-white text-gray-700 px-6 pb-6 text-right rounded-b-lg', 'dark:bg-gray-900 dark:text-white/80']
|
2023-08-07 09:03:52 +00:00
|
|
|
},
|
|
|
|
mask: ({ props }) => ({
|
|
|
|
class: ['transition duration-200', { 'bg-black/40': props.modal }]
|
|
|
|
}),
|
|
|
|
transition: ({ props }) => {
|
|
|
|
return props.position === 'top'
|
|
|
|
? {
|
|
|
|
enterFromClass: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0',
|
|
|
|
enterActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveToClass: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0'
|
|
|
|
}
|
|
|
|
: props.position === 'bottom'
|
|
|
|
? {
|
|
|
|
enterFromClass: 'opacity-0 scale-75 translate-y-full',
|
|
|
|
enterActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveToClass: 'opacity-0 scale-75 translate-x-0 translate-y-full translate-z-0'
|
|
|
|
}
|
|
|
|
: props.position === 'left' || props.position === 'topleft' || props.position === 'bottomleft'
|
|
|
|
? {
|
|
|
|
enterFromClass: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0',
|
|
|
|
enterActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveToClass: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0'
|
|
|
|
}
|
|
|
|
: props.position === 'right' || props.position === 'topright' || props.position === 'bottomright'
|
|
|
|
? {
|
|
|
|
enterFromClass: 'opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0',
|
|
|
|
enterActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveToClass: 'opacity-0 scale-75 opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0'
|
|
|
|
}
|
|
|
|
: {
|
|
|
|
enterFromClass: 'opacity-0 scale-75',
|
|
|
|
enterActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveActiveClass: 'transition-all duration-200 ease-out',
|
|
|
|
leaveToClass: 'opacity-0 scale-75'
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
},
|
|
|
|
code2: {
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-08-07 09:03:52 +00:00
|
|
|
<div class="card flex justify-center">
|
|
|
|
<Button label="Show" icon="pi pi-external-link" @click="visible = true" />
|
|
|
|
<Dialog v-model:visible="visible" modal header="Header" :style="{ width: '50vw' }">
|
|
|
|
<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.
|
|
|
|
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
|
|
</p>
|
|
|
|
</Dialog>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const visible = ref(false);
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-08-07 09:03:52 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|