MultiSelect pt demo added
parent
be8c5bbbc7
commit
f9d732a403
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<script>
|
||||
|
@ -9,7 +9,6 @@ import ChipsDoc from '@/doc/multiselect/ChipsDoc';
|
|||
import DisabledDoc from '@/doc/multiselect/DisabledDoc';
|
||||
import FilterDoc from '@/doc/multiselect/FilterDoc';
|
||||
import FloatLabelDoc from '@/doc/multiselect/FloatLabelDoc';
|
||||
import VeeValidateDoc from '@/doc/multiselect/form/VeeValidateDoc';
|
||||
import GroupDoc from '@/doc/multiselect/GroupDoc';
|
||||
import ImportDoc from '@/doc/multiselect/ImportDoc';
|
||||
import InvalidDoc from '@/doc/multiselect/InvalidDoc';
|
||||
|
@ -17,6 +16,9 @@ import LoadingStateDoc from '@/doc/multiselect/LoadingStateDoc';
|
|||
import StyleDoc from '@/doc/multiselect/StyleDoc';
|
||||
import TemplateDoc from '@/doc/multiselect/TemplateDoc';
|
||||
import VirtualScrollDoc from '@/doc/multiselect/VirtualScrollDoc';
|
||||
import VeeValidateDoc from '@/doc/multiselect/form/VeeValidateDoc';
|
||||
import PTComponent from '@/doc/multiselect/pt/index.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -98,7 +100,8 @@ export default {
|
|||
label: 'Accessibility',
|
||||
component: AccessibilityDoc
|
||||
}
|
||||
]
|
||||
],
|
||||
ptComponent: PTComponent
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue