TabMenu & TieredMenu pt demos added

pull/3913/head
Tuğçe Küçükoğlu 2023-04-28 10:24:00 +03:00
parent 39bd79dc10
commit e8199b9884
8 changed files with 677 additions and 4 deletions

140
doc/tabmenu/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,140 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card">
<TabMenu
:model="items"
:pt="{
action: ({ props, state, options }) => ({
class: options.order === state.d_activeIndex ? 'bg-primary' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Home',
icon: 'pi pi-fw pi-home'
},
{
label: 'Calendar',
icon: 'pi pi-fw pi-calendar'
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil'
},
{
label: 'Documentation',
icon: 'pi pi-fw pi-file'
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog'
}
],
code: {
basic: `
<TabMenu
:model="items"
:pt="{
action: ({ props, state, index }) => ({
class: index === state.d_activeIndex ? 'bg-primary' : undefined
})
}"
/>`,
options: `
<template>
<div class="card">
<TabMenu
:model="items"
:pt="{
action: ({ props, state, index }) => ({
class: index === state.d_activeIndex ? 'bg-primary' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Home',
icon: 'pi pi-fw pi-home'
},
{
label: 'Calendar',
icon: 'pi pi-fw pi-calendar'
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil'
},
{
label: 'Documentation',
icon: 'pi pi-fw pi-file'
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog'
}
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card">
<TabMenu
:model="items"
:pt="{
action: ({ props, state, index }) => ({
class: index === state.d_activeIndex ? 'bg-primary' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const items = ref([
{
label: 'Home',
icon: 'pi pi-fw pi-home'
},
{
label: 'Calendar',
icon: 'pi pi-fw pi-calendar'
},
{
label: 'Edit',
icon: 'pi pi-fw pi-pencil'
},
{
label: 'Documentation',
icon: 'pi pi-fw pi-file'
},
{
label: 'Settings',
icon: 'pi pi-fw pi-cog'
}
]);
<\/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/tabmenu/pt/index.vue Normal file
View File

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

431
doc/tieredmenu/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,431 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<TieredMenu
: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'
}
]
}
]
},
{
separator: true
},
{
label: 'Quit',
icon: 'pi pi-fw pi-power-off'
}
],
code: {
basic: `
<TieredMenu :model="items" />`,
options: `
<template>
<div class="card flex justify-content-center">
<TieredMenu :model="items" />
</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'
}
]
}
]
},
{
separator: true
},
{
label: 'Quit',
icon: 'pi pi-fw pi-power-off'
}
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<TieredMenu :model="items" />
</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'
}
]
}
]
},
{
separator: true
},
{
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>

View File

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

View File

@ -1,8 +1,9 @@
<template> <template>
<DocComponent title="Vue TabMenu Component" header="TabMenu" description="TabMenu is a navigation/command component that displays items as tab headers." :componentDocs="docs" :apiDocs="['TabMenu', 'MenuItem']" /> <DocComponent title="Vue TabMenu Component" header="TabMenu" description="TabMenu is a navigation/command component that displays items as tab headers." :componentDocs="docs" :apiDocs="['TabMenu', 'MenuItem']" :ptTabComponent="ptComponent" />
</template> </template>
<script> <script>
import PTComponent from '@/doc/tabmenu/pt/index.vue';
import AccessibilityDoc from '../doc/tabmenu/AccessibilityDoc.vue'; import AccessibilityDoc from '../doc/tabmenu/AccessibilityDoc.vue';
import BasicDoc from '../doc/tabmenu/BasicDoc.vue'; import BasicDoc from '../doc/tabmenu/BasicDoc.vue';
import ControlledDoc from '../doc/tabmenu/ControlledDoc.vue'; import ControlledDoc from '../doc/tabmenu/ControlledDoc.vue';
@ -38,7 +39,8 @@ export default {
label: 'Accessibility', label: 'Accessibility',
component: AccessibilityDoc component: AccessibilityDoc
} }
] ],
ptComponent: PTComponent
}; };
} }
}; };

View File

@ -1,5 +1,5 @@
<template> <template>
<DocComponent title="Vue TieredMenu Component" header="TieredMenu" description="TieredMenu displays submenus in nested overlays." :componentDocs="docs" :apiDocs="['TieredMenu', 'MenuItem']" /> <DocComponent title="Vue TieredMenu Component" header="TieredMenu" description="TieredMenu displays submenus in nested overlays." :componentDocs="docs" :apiDocs="['TieredMenu', 'MenuItem']" :ptTabComponent="ptComponent" />
</template> </template>
<script> <script>
@ -8,6 +8,7 @@ import BasicDoc from '@/doc/tieredmenu/BasicDoc';
import ImportDoc from '@/doc/tieredmenu/ImportDoc'; import ImportDoc from '@/doc/tieredmenu/ImportDoc';
import PopupDoc from '@/doc/tieredmenu/PopupDoc'; import PopupDoc from '@/doc/tieredmenu/PopupDoc';
import StyleDoc from '@/doc/tieredmenu/StyleDoc'; import StyleDoc from '@/doc/tieredmenu/StyleDoc';
import PTComponent from '@/doc/tieredmenu/pt/index.vue';
export default { export default {
data() { data() {
@ -38,7 +39,8 @@ export default {
label: 'Accessibility', label: 'Accessibility',
component: AccessibilityDoc component: AccessibilityDoc
} }
] ],
ptComponent: PTComponent
}; };
} }
}; };