Listbox pt demo added

pull/3938/head
Tuğçe Küçükoğlu 2023-05-08 00:08:46 +03:00
parent b57edbd58a
commit 812e6c6a8c
4 changed files with 165 additions and 3 deletions

110
doc/listbox/pt/PTDoc.vue Normal file
View File

@ -0,0 +1,110 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<Listbox
v-model="selectedCity"
:options="cities"
optionLabel="name"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-primary' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
selectedCity: null,
cities: [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
],
code: {
basic: `
<Listbox
v-model="selectedCity"
:options="cities"
optionLabel="name"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-primary' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>`,
options: `
<template>
<div class="card flex justify-content-center">
<Listbox
v-model="selectedCity"
:options="cities"
optionLabel="name"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-primary' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
selectedCity: null,
cities: [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
]
};
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<Listbox
v-model="selectedCity"
:options="cities"
optionLabel="name"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-primary' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const selectedCity = ref();
const cities = ref([
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
]);
<\/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/listbox/pt/index.vue Normal file
View File

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

View File

@ -1,5 +1,5 @@
<template>
<DocComponent title="Vue Listbox Component" header="Listbox" description="Listbox is used to select one or more values from a list of items." :componentDocs="docs" :apiDocs="['Listbox']" />
<DocComponent title="Vue Listbox Component" header="Listbox" description="Listbox is used to select one or more values from a list of items." :componentDocs="docs" :apiDocs="['Listbox']" :ptTabComponent="ptComponent" />
</template>
<script>
@ -7,7 +7,6 @@ import AccessibilityDoc from '@/doc/listbox/AccessibilityDoc';
import BasicDoc from '@/doc/listbox/BasicDoc';
import DisabledDoc from '@/doc/listbox/DisabledDoc';
import FilterDoc from '@/doc/listbox/FilterDoc';
import VeeValidateDoc from '@/doc/listbox/form/VeeValidateDoc';
import GroupDoc from '@/doc/listbox/GroupDoc';
import ImportDoc from '@/doc/listbox/ImportDoc';
import InvalidDoc from '@/doc/listbox/InvalidDoc';
@ -15,6 +14,9 @@ import MultipleDoc from '@/doc/listbox/MultipleDoc';
import StyleDoc from '@/doc/listbox/StyleDoc';
import TemplateDoc from '@/doc/listbox/TemplateDoc';
import VirtualScrollDoc from '@/doc/listbox/VirtualScrollDoc';
import VeeValidateDoc from '@/doc/listbox/form/VeeValidateDoc';
import PTComponent from '@/doc/listbox/pt/index.vue';
export default {
data() {
return {
@ -86,7 +88,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};