AutoComplete pt demo added

pull/3925/head
Tuğçe Küçükoğlu 2023-05-05 09:46:20 +03:00
parent 5162ceedd5
commit 1f00024df1
4 changed files with 155 additions and 3 deletions

View File

@ -0,0 +1,94 @@
<template>
<DocSectionText v-bind="$attrs"></DocSectionText>
<div class="card flex justify-content-center">
<AutoComplete
v-model="value"
:suggestions="items"
@complete="search"
:pt="{
input: { class: 'w-16rem' }
}"
/>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: '',
items: [],
code: {
basic: `
<AutoComplete
v-model="value"
:suggestions="items"
@complete="search"
:pt="{
input: { class: 'w-16rem' }
}"
/>`,
options: `
<template>
<div class="card flex justify-content-center">
<AutoComplete
v-model="value"
:suggestions="items"
@complete="search"
:pt="{
input: { class: 'w-16rem' }
}"
/>
</div>
</template>
<script>
export default {
data() {
return {
value: '',
items: []
};
},
methods: {
search(event) {
this.items = [...Array(10).keys()].map((item) => event.query + '-' + item);
}
}
};
<\/script>`,
composition: `
<template>
<div class="card flex justify-content-center">
<AutoComplete
v-model="value"
:suggestions="items"
@complete="search"
:pt="{
input: { class: 'w-16rem' }
}"
/>
</div>
</template>
<script setup>
import { ref } from "vue";
const value = ref("");
const items = ref([]);
const search = (event) => {
items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
}
<\/script>`
}
};
},
methods: {
search(event) {
this.items = [...Array(10).keys()].map((item) => event.query + '-' + item);
}
}
};
</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>AutoComplete 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.autocomplete',
label: 'AutoComplete PT Options',
component: DocApiTable,
data: getPTOption('AutoComplete')
},
{
id: 'pt.demo',
label: 'Demo',
component: PtDoc
}
]
};
}
};
</script>

View File

@ -1,5 +1,12 @@
<template>
<DocComponent title="Vue AutoComplete Component" header="AutoComplete" description="AutoComplete is an input component that provides real-time suggestions when being typed." :componentDocs="docs" :apiDocs="['AutoComplete']" />
<DocComponent
title="Vue AutoComplete Component"
header="AutoComplete"
description="AutoComplete is an input component that provides real-time suggestions when being typed."
:componentDocs="docs"
:apiDocs="['AutoComplete']"
:ptTabComponent="ptComponent"
/>
</template>
<script>
@ -9,7 +16,6 @@ import DisabledDoc from '@/doc/autocomplete/DisabledDoc';
import DropdownDoc from '@/doc/autocomplete/DropdownDoc';
import FloatLabelDoc from '@/doc/autocomplete/FloatLabelDoc';
import ForceSelectionDoc from '@/doc/autocomplete/ForceSelectionDoc';
import VeeValidateDoc from '@/doc/autocomplete/form/VeeValidateDoc.vue';
import GroupDoc from '@/doc/autocomplete/GroupDoc';
import ImportDoc from '@/doc/autocomplete/ImportDoc';
import InvalidDoc from '@/doc/autocomplete/InvalidDoc';
@ -18,6 +24,8 @@ import ObjectsDoc from '@/doc/autocomplete/ObjectsDoc';
import StyleDoc from '@/doc/autocomplete/StyleDoc';
import TemplateDoc from '@/doc/autocomplete/TemplateDoc';
import VirtualScrollDoc from '@/doc/autocomplete/VirtualScrollDoc';
import VeeValidateDoc from '@/doc/autocomplete/form/VeeValidateDoc.vue';
import PTComponent from '@/doc/autocomplete/pt/index.vue';
export default {
data() {
@ -105,7 +113,8 @@ export default {
label: 'Accessibility',
component: AccessibilityDoc
}
]
],
ptComponent: PTComponent
};
}
};