MultiSelect pt demo added

pull/3938/head
Tuğçe Küçükoğlu 2023-05-08 10:01:31 +03:00
parent be8c5bbbc7
commit f9d732a403
4 changed files with 173 additions and 3 deletions

View File

@ -0,0 +1,118 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<MultiSelect
v-model="selectedCities"
:options="cities"
optionLabel="name"
placeholder="Select Cities"
:maxSelectedLabels="3"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-blue-300' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
selectedCities: 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: `
<MultiSelect
v-model="selectedCities"
:options="cities"
optionLabel="name"
placeholder="Select Cities"
:maxSelectedLabels="3"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-blue-300' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>`,
options: `
<template>
<div class="card flex justify-content-center">
<MultiSelect
v-model="selectedCities"
:options="cities"
optionLabel="name"
placeholder="Select Cities"
:maxSelectedLabels="3"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-blue-300' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
selectedCities: 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">
<MultiSelect
v-model="selectedCities"
:options="cities"
optionLabel="name"
placeholder="Select Cities"
:maxSelectedLabels="3"
:pt="{
root: { class: 'w-full md:w-14rem' },
item: ({ props, state, context }) => ({
class: context.selected ? 'bg-blue-300' : context.focused ? 'bg-blue-100' : undefined
})
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const selectedCities = 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>

View File

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

View File

@ -1,5 +1,5 @@
<template> <template>
<DocComponent title="Vue MultiSelect Component" header="MultiSelect" description="MultiSelect is used to select multiple items from a collection." :componentDocs="docs" :apiDocs="['MultiSelect']" /> <DocComponent title="Vue MultiSelect Component" header="MultiSelect" description="MultiSelect is used to select multiple items from a collection." :componentDocs="docs" :apiDocs="['MultiSelect']" :ptTabComponent="ptComponent" />
</template> </template>
<script> <script>
@ -9,7 +9,6 @@ import ChipsDoc from '@/doc/multiselect/ChipsDoc';
import DisabledDoc from '@/doc/multiselect/DisabledDoc'; import DisabledDoc from '@/doc/multiselect/DisabledDoc';
import FilterDoc from '@/doc/multiselect/FilterDoc'; import FilterDoc from '@/doc/multiselect/FilterDoc';
import FloatLabelDoc from '@/doc/multiselect/FloatLabelDoc'; import FloatLabelDoc from '@/doc/multiselect/FloatLabelDoc';
import VeeValidateDoc from '@/doc/multiselect/form/VeeValidateDoc';
import GroupDoc from '@/doc/multiselect/GroupDoc'; import GroupDoc from '@/doc/multiselect/GroupDoc';
import ImportDoc from '@/doc/multiselect/ImportDoc'; import ImportDoc from '@/doc/multiselect/ImportDoc';
import InvalidDoc from '@/doc/multiselect/InvalidDoc'; import InvalidDoc from '@/doc/multiselect/InvalidDoc';
@ -17,6 +16,9 @@ import LoadingStateDoc from '@/doc/multiselect/LoadingStateDoc';
import StyleDoc from '@/doc/multiselect/StyleDoc'; import StyleDoc from '@/doc/multiselect/StyleDoc';
import TemplateDoc from '@/doc/multiselect/TemplateDoc'; import TemplateDoc from '@/doc/multiselect/TemplateDoc';
import VirtualScrollDoc from '@/doc/multiselect/VirtualScrollDoc'; import VirtualScrollDoc from '@/doc/multiselect/VirtualScrollDoc';
import VeeValidateDoc from '@/doc/multiselect/form/VeeValidateDoc';
import PTComponent from '@/doc/multiselect/pt/index.vue';
export default { export default {
data() { data() {
return { return {
@ -98,7 +100,8 @@ export default {
label: 'Accessibility', label: 'Accessibility',
component: AccessibilityDoc component: AccessibilityDoc
} }
] ],
ptComponent: PTComponent
}; };
} }
}; };