MegaMenu & Menubar pt demo added

pull/3913/head
Tuğçe Küçükoğlu 2023-04-27 18:28:36 +03:00
parent 2d2d83319e
commit 3b5bb32bb2
8 changed files with 971 additions and 4 deletions

422
doc/megamenu/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,422 @@
<template>
<DocSectionText v-bind="$attrs"> </DocSectionText>
<div class="card">
<MegaMenu
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Videos',
icon: 'pi pi-fw pi-video',
items: [
[
{
label: 'Video 1',
items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
},
{
label: 'Video 2',
items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
}
],
[
{
label: 'Video 3',
items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
},
{
label: 'Video 4',
items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
}
]
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-users',
items: [
[
{
label: 'User 1',
items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
},
{
label: 'User 2',
items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
}
],
[
{
label: 'User 3',
items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
},
{
label: 'User 4',
items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
}
],
[
{
label: 'User 5',
items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
},
{
label: 'User 6',
items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
}
]
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
[
{
label: 'Event 1',
items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
},
{
label: 'Event 2',
items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
}
],
[
{
label: 'Event 3',
items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
},
{
label: 'Event 4',
items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
}
]
]
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog',
items: [
[
{
label: 'Setting 1',
items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
},
{
label: 'Setting 2',
items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
},
{
label: 'Setting 3',
items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
}
],
[
{
label: 'Technology 4',
items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
}
]
]
}
],
code: {
basic: `
<MegaMenu
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>`,
options: `
<template>
<div class="card">
<MegaMenu
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Videos',
icon: 'pi pi-fw pi-video',
items: [
[
{
label: 'Video 1',
items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
},
{
label: 'Video 2',
items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
}
],
[
{
label: 'Video 3',
items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
},
{
label: 'Video 4',
items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
}
]
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-users',
items: [
[
{
label: 'User 1',
items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
},
{
label: 'User 2',
items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
}
],
[
{
label: 'User 3',
items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
},
{
label: 'User 4',
items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
}
],
[
{
label: 'User 5',
items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
},
{
label: 'User 6',
items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
}
]
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
[
{
label: 'Event 1',
items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
},
{
label: 'Event 2',
items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
}
],
[
{
label: 'Event 3',
items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
},
{
label: 'Event 4',
items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
}
]
]
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog',
items: [
[
{
label: 'Setting 1',
items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
},
{
label: 'Setting 2',
items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
},
{
label: 'Setting 3',
items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
}
],
[
{
label: 'Technology 4',
items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
}
]
]
}
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card">
<MegaMenu
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
label: 'Videos',
icon: 'pi pi-fw pi-video',
items: [
[
{
label: 'Video 1',
items: [{ label: 'Video 1.1' }, { label: 'Video 1.2' }]
},
{
label: 'Video 2',
items: [{ label: 'Video 2.1' }, { label: 'Video 2.2' }]
}
],
[
{
label: 'Video 3',
items: [{ label: 'Video 3.1' }, { label: 'Video 3.2' }]
},
{
label: 'Video 4',
items: [{ label: 'Video 4.1' }, { label: 'Video 4.2' }]
}
]
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-users',
items: [
[
{
label: 'User 1',
items: [{ label: 'User 1.1' }, { label: 'User 1.2' }]
},
{
label: 'User 2',
items: [{ label: 'User 2.1' }, { label: 'User 2.2' }]
}
],
[
{
label: 'User 3',
items: [{ label: 'User 3.1' }, { label: 'User 3.2' }]
},
{
label: 'User 4',
items: [{ label: 'User 4.1' }, { label: 'User 4.2' }]
}
],
[
{
label: 'User 5',
items: [{ label: 'User 5.1' }, { label: 'User 5.2' }]
},
{
label: 'User 6',
items: [{ label: 'User 6.1' }, { label: 'User 6.2' }]
}
]
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
[
{
label: 'Event 1',
items: [{ label: 'Event 1.1' }, { label: 'Event 1.2' }]
},
{
label: 'Event 2',
items: [{ label: 'Event 2.1' }, { label: 'Event 2.2' }]
}
],
[
{
label: 'Event 3',
items: [{ label: 'Event 3.1' }, { label: 'Event 3.2' }]
},
{
label: 'Event 4',
items: [{ label: 'Event 4.1' }, { label: 'Event 4.2' }]
}
]
]
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog',
items: [
[
{
label: 'Setting 1',
items: [{ label: 'Setting 1.1' }, { label: 'Setting 1.2' }]
},
{
label: 'Setting 2',
items: [{ label: 'Setting 2.1' }, { label: 'Setting 2.2' }]
},
{
label: 'Setting 3',
items: [{ label: 'Setting 3.1' }, { label: 'Setting 3.2' }]
}
],
[
{
label: 'Technology 4',
items: [{ label: 'Setting 4.1' }, { label: 'Setting 4.2' }]
}
]
]
}
]);
<\/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/megamenu/pt/index.vue Normal file
View File

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

443
doc/menubar/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,443 @@
<template>
<DocSectionText v-bind="$attrs"> </DocSectionText>
<div class="card relative z-2">
<Menubar
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'File',
icon: 'pi pi-fw pi-file',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-plus',
items: [
{
label: 'Bookmark',
icon: 'pi pi-fw pi-bookmark'
},
{
label: 'Video',
icon: 'pi pi-fw pi-video'
}
]
},
{
label: 'Delete',
icon: 'pi pi-fw pi-trash'
},
{
separator: true
},
{
label: 'Export',
icon: 'pi pi-fw pi-external-link'
}
]
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Left',
icon: 'pi pi-fw pi-align-left'
},
{
label: 'Right',
icon: 'pi pi-fw pi-align-right'
},
{
label: 'Center',
icon: 'pi pi-fw pi-align-center'
},
{
label: 'Justify',
icon: 'pi pi-fw pi-align-justify'
}
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-user',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-user-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-user-minus'
},
{
label: 'Search',
icon: 'pi pi-fw pi-users',
items: [
{
label: 'Filter',
icon: 'pi pi-fw pi-filter',
items: [
{
label: 'Print',
icon: 'pi pi-fw pi-print'
}
]
},
{
icon: 'pi pi-fw pi-bars',
label: 'List'
}
]
}
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Save',
icon: 'pi pi-fw pi-calendar-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-calendar-minus'
}
]
},
{
label: 'Archieve',
icon: 'pi pi-fw pi-calendar-times',
items: [
{
label: 'Remove',
icon: 'pi pi-fw pi-calendar-minus'
}
]
}
]
},
{
label: 'Quit',
icon: 'pi pi-fw pi-power-off'
}
],
code: {
basic: `
<Menubar
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>`,
options: `
<template>
<div class="card relative z-2">
<Menubar
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'File',
icon: 'pi pi-fw pi-file',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-plus',
items: [
{
label: 'Bookmark',
icon: 'pi pi-fw pi-bookmark'
},
{
label: 'Video',
icon: 'pi pi-fw pi-video'
}
]
},
{
label: 'Delete',
icon: 'pi pi-fw pi-trash'
},
{
separator: true
},
{
label: 'Export',
icon: 'pi pi-fw pi-external-link'
}
]
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Left',
icon: 'pi pi-fw pi-align-left'
},
{
label: 'Right',
icon: 'pi pi-fw pi-align-right'
},
{
label: 'Center',
icon: 'pi pi-fw pi-align-center'
},
{
label: 'Justify',
icon: 'pi pi-fw pi-align-justify'
}
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-user',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-user-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-user-minus'
},
{
label: 'Search',
icon: 'pi pi-fw pi-users',
items: [
{
label: 'Filter',
icon: 'pi pi-fw pi-filter',
items: [
{
label: 'Print',
icon: 'pi pi-fw pi-print'
}
]
},
{
icon: 'pi pi-fw pi-bars',
label: 'List'
}
]
}
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Save',
icon: 'pi pi-fw pi-calendar-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-calendar-minus'
}
]
},
{
label: 'Archieve',
icon: 'pi pi-fw pi-calendar-times',
items: [
{
label: 'Remove',
icon: 'pi pi-fw pi-calendar-minus'
}
]
}
]
},
{
label: 'Quit',
icon: 'pi pi-fw pi-power-off'
}
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card relative z-2">
<Menubar
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.active ? 'bg-primary-200 border-round-sm' : options.focused ? 'bg-primary-300 border-round-sm' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
label: 'File',
icon: 'pi pi-fw pi-file',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-plus',
items: [
{
label: 'Bookmark',
icon: 'pi pi-fw pi-bookmark'
},
{
label: 'Video',
icon: 'pi pi-fw pi-video'
}
]
},
{
label: 'Delete',
icon: 'pi pi-fw pi-trash'
},
{
separator: true
},
{
label: 'Export',
icon: 'pi pi-fw pi-external-link'
}
]
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Left',
icon: 'pi pi-fw pi-align-left'
},
{
label: 'Right',
icon: 'pi pi-fw pi-align-right'
},
{
label: 'Center',
icon: 'pi pi-fw pi-align-center'
},
{
label: 'Justify',
icon: 'pi pi-fw pi-align-justify'
}
]
},
{
label: 'Users',
icon: 'pi pi-fw pi-user',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-user-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-user-minus'
},
{
label: 'Search',
icon: 'pi pi-fw pi-users',
items: [
{
label: 'Filter',
icon: 'pi pi-fw pi-filter',
items: [
{
label: 'Print',
icon: 'pi pi-fw pi-print'
}
]
},
{
icon: 'pi pi-fw pi-bars',
label: 'List'
}
]
}
]
},
{
label: 'Events',
icon: 'pi pi-fw pi-calendar',
items: [
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil',
items: [
{
label: 'Save',
icon: 'pi pi-fw pi-calendar-plus'
},
{
label: 'Delete',
icon: 'pi pi-fw pi-calendar-minus'
}
]
},
{
label: 'Archieve',
icon: 'pi pi-fw pi-calendar-times',
items: [
{
label: 'Remove',
icon: 'pi pi-fw pi-calendar-minus'
}
]
}
]
},
{
label: 'Quit',
icon: 'pi pi-fw pi-power-off'
}
]);
<\/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/menubar/pt/index.vue Normal file
View File

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

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue MegaMenu Component" header="MegaMenu" description="MegaMenu is navigation component that displays submenus together." :componentDocs="docs" :apiDocs="['MegaMenu', 'MenuItem']" />
<DocComponent title="Vue MegaMenu Component" header="MegaMenu" description="MegaMenu is navigation component that displays submenus together." :componentDocs="docs" :apiDocs="['MegaMenu', 'MenuItem']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -9,6 +9,7 @@ import ImportDoc from '@/doc/megamenu/ImportDoc';
import StyleDoc from '@/doc/megamenu/StyleDoc';
import TemplateDoc from '@/doc/megamenu/TemplateDoc';
import VerticalDoc from '@/doc/megamenu/VerticalDoc';
import PTComponent from '@/doc/megamenu/pt/index.vue';
export default {
data() {
@ -44,7 +45,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Navbar Component" header="Menubar" description="Menubar also known as Navbar, is a horizontal menu component." :componentDocs="docs" :apiDocs="['Menubar', 'MenuItem']" />
<DocComponent title="Vue Navbar Component" header="Menubar" description="Menubar also known as Navbar, is a horizontal menu component." :componentDocs="docs" :apiDocs="['Menubar', 'MenuItem']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -8,6 +8,7 @@ import BasicDoc from '@/doc/menubar/BasicDoc';
import ImportDoc from '@/doc/menubar/ImportDoc';
import StyleDoc from '@/doc/menubar/StyleDoc';
import TemplateDoc from '@/doc/menubar/TemplateDoc';
import PTComponent from '@/doc/menubar/pt/index.vue';
export default {
data() {
@ -38,7 +39,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};