Label support for AutoComplete
parent
3ed723787f
commit
4033c34309
|
@ -2,10 +2,20 @@
|
||||||
<DocSectionText v-bind="$attrs">
|
<DocSectionText v-bind="$attrs">
|
||||||
<p>A floating label appears on top of the input field when focused. Visit <PrimeVueNuxtLink to="/floatlabel">FloatLabel</PrimeVueNuxtLink> documentation for more information.</p>
|
<p>A floating label appears on top of the input field when focused. Visit <PrimeVueNuxtLink to="/floatlabel">FloatLabel</PrimeVueNuxtLink> documentation for more information.</p>
|
||||||
</DocSectionText>
|
</DocSectionText>
|
||||||
<div class="card flex justify-center">
|
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||||
<FloatLabel>
|
<FloatLabel>
|
||||||
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
<AutoComplete v-model="value1" inputId="over_label" :suggestions="items" @complete="search" />
|
||||||
<label for="ac">Float Label</label>
|
<label for="over_label">Over Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="in">
|
||||||
|
<AutoComplete v-model="value2" inputId="in_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="in_label">In Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="on">
|
||||||
|
<AutoComplete v-model="value3" inputId="on_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="on_label">On Label</label>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</div>
|
</div>
|
||||||
<DocSectionCode :code="code" />
|
<DocSectionCode :code="code" />
|
||||||
|
@ -15,21 +25,43 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: '',
|
value1: '',
|
||||||
|
value2: '',
|
||||||
|
value3: '',
|
||||||
items: [],
|
items: [],
|
||||||
code: {
|
code: {
|
||||||
basic: `
|
basic: `
|
||||||
<FloatLabel>
|
<FloatLabel>
|
||||||
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
<AutoComplete v-model="value1" inputId="over_label" :suggestions="items" @complete="search" />
|
||||||
<label for="ac">Float Label</label>
|
<label for="over_label">Over Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="in">
|
||||||
|
<AutoComplete v-model="value2" inputId="in_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="in_label">In Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="on">
|
||||||
|
<AutoComplete v-model="value3" inputId="on_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="on_label">On Label</label>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
`,
|
`,
|
||||||
options: `
|
options: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card flex justify-center">
|
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||||
<FloatLabel>
|
<FloatLabel>
|
||||||
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
<AutoComplete v-model="value1" inputId="over_label" :suggestions="items" @complete="search" />
|
||||||
<label for="ac">Float Label</label>
|
<label for="over_label">Over Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="in">
|
||||||
|
<AutoComplete v-model="value2" inputId="in_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="in_label">In Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="on">
|
||||||
|
<AutoComplete v-model="value3" inputId="on_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="on_label">On Label</label>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -38,7 +70,9 @@ export default {
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: '',
|
value1: '',
|
||||||
|
value2: '',
|
||||||
|
value3: '',
|
||||||
items: []
|
items: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -52,10 +86,20 @@ export default {
|
||||||
`,
|
`,
|
||||||
composition: `
|
composition: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card flex justify-center">
|
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||||
<FloatLabel>
|
<FloatLabel>
|
||||||
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
<AutoComplete v-model="value1" inputId="over_label" :suggestions="items" @complete="search" />
|
||||||
<label for="ac">Float Label</label>
|
<label for="over_label">Over Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="in">
|
||||||
|
<AutoComplete v-model="value2" inputId="in_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="in_label">In Label</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<FloatLabel variant="on">
|
||||||
|
<AutoComplete v-model="value3" inputId="on_label" :suggestions="items" @complete="search" />
|
||||||
|
<label for="on_label">On Label</label>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -63,7 +107,9 @@ export default {
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
const value = ref("");
|
const value1 = ref('');
|
||||||
|
const value2 = ref('');
|
||||||
|
const value3 = ref('');
|
||||||
const items = ref([]);
|
const items = ref([]);
|
||||||
|
|
||||||
const search = (event) => {
|
const search = (event) => {
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
<template>
|
||||||
|
<DocSectionText v-bind="$attrs">
|
||||||
|
<p>IftaLabel is used to create infield top aligned labels. Visit <PrimeVueNuxtLink to="/iftalabel">IftaLabel</PrimeVueNuxtLink> documentation for more information.</p>
|
||||||
|
</DocSectionText>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<IftaLabel>
|
||||||
|
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
||||||
|
<label for="ac">Identifier</label>
|
||||||
|
</IftaLabel>
|
||||||
|
</div>
|
||||||
|
<DocSectionCode :code="code" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
value: '',
|
||||||
|
items: [],
|
||||||
|
code: {
|
||||||
|
basic: `
|
||||||
|
<IftaLabel>
|
||||||
|
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
||||||
|
<label for="ac">Identifier</label>
|
||||||
|
</IftaLabel>
|
||||||
|
`,
|
||||||
|
options: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<IftaLabel>
|
||||||
|
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
||||||
|
<label for="ac">Identifier</label>
|
||||||
|
</IftaLabel>
|
||||||
|
</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-center">
|
||||||
|
<IftaLabel>
|
||||||
|
<AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" />
|
||||||
|
<label for="ac">Identifier</label>
|
||||||
|
</IftaLabel>
|
||||||
|
</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>
|
|
@ -19,6 +19,7 @@ import FilledDoc from '@/doc/autocomplete/FilledDoc.vue';
|
||||||
import FloatLabelDoc from '@/doc/autocomplete/FloatLabelDoc.vue';
|
import FloatLabelDoc from '@/doc/autocomplete/FloatLabelDoc.vue';
|
||||||
import ForceSelectionDoc from '@/doc/autocomplete/ForceSelectionDoc.vue';
|
import ForceSelectionDoc from '@/doc/autocomplete/ForceSelectionDoc.vue';
|
||||||
import GroupDoc from '@/doc/autocomplete/GroupDoc.vue';
|
import GroupDoc from '@/doc/autocomplete/GroupDoc.vue';
|
||||||
|
import IftaLabelDoc from '@/doc/autocomplete/IftaLabelDoc.vue';
|
||||||
import ImportDoc from '@/doc/autocomplete/ImportDoc.vue';
|
import ImportDoc from '@/doc/autocomplete/ImportDoc.vue';
|
||||||
import InvalidDoc from '@/doc/autocomplete/InvalidDoc.vue';
|
import InvalidDoc from '@/doc/autocomplete/InvalidDoc.vue';
|
||||||
import MultipleDoc from '@/doc/autocomplete/MultipleDoc.vue';
|
import MultipleDoc from '@/doc/autocomplete/MultipleDoc.vue';
|
||||||
|
@ -82,6 +83,11 @@ export default {
|
||||||
label: 'Float Label',
|
label: 'Float Label',
|
||||||
component: FloatLabelDoc
|
component: FloatLabelDoc
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'iftalabel',
|
||||||
|
label: 'Ifta Label',
|
||||||
|
component: IftaLabelDoc
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'filled',
|
id: 'filled',
|
||||||
label: 'Filled',
|
label: 'Filled',
|
||||||
|
|
Loading…
Reference in New Issue