New label demos for inputmask

pull/6439/head
Cagatay Civici 2024-09-18 13:49:16 +03:00
parent 1d7f5bfdda
commit a5bfe0526b
3 changed files with 132 additions and 14 deletions

View File

@ -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 justify-center items-end gap-4">
<FloatLabel> <FloatLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" placeholder="999-99-9999" /> <InputMask id="over_label" v-model="value1" mask="999-99-9999" />
<label for="ssn">SSN</label> <label for="over_label">Over Label</label>
</FloatLabel>
<FloatLabel variant="in">
<InputMask id="in_label" v-model="value2" mask="999-99-9999" />
<label for="in_label">In Label</label>
</FloatLabel>
<FloatLabel variant="on">
<InputMask id="on_label" v-model="value3" mask="999-99-9999" />
<label for="on_label">On Label</label>
</FloatLabel> </FloatLabel>
</div> </div>
<DocSectionCode :code="code" /> <DocSectionCode :code="code" />
@ -15,20 +25,42 @@
export default { export default {
data() { data() {
return { return {
value: '', value1: '',
value2: '',
value3: '',
code: { code: {
basic: ` basic: `
<FloatLabel> <FloatLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" placeholder="999-99-9999" /> <InputMask id="over_label" v-model="value1" mask="999-99-9999" />
<label for="ssn">SSN</label> <label for="over_label">Over Label</label>
</FloatLabel>
<FloatLabel variant="in">
<InputMask id="in_label" v-model="value2" mask="999-99-9999" />
<label for="in_label">In Label</label>
</FloatLabel>
<FloatLabel variant="on">
<InputMask id="on_label" v-model="value3" mask="999-99-9999" />
<label for="on_label">On Label</label>
</FloatLabel> </FloatLabel>
`, `,
options: ` options: `
<template> <template>
<div class="card flex justify-center"> <div class="card flex justify-center items-end gap-4">
<FloatLabel> <FloatLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" placeholder="999-99-9999" /> <InputMask id="over_label" v-model="value1" mask="999-99-9999" />
<label for="ssn">SSN</label> <label for="over_label">Over Label</label>
</FloatLabel>
<FloatLabel variant="in">
<InputMask id="in_label" v-model="value2" mask="999-99-9999" />
<label for="in_label">In Label</label>
</FloatLabel>
<FloatLabel variant="on">
<InputMask id="on_label" v-model="value3" mask="999-99-9999" />
<label for="on_label">On Label</label>
</FloatLabel> </FloatLabel>
</div> </div>
</template> </template>
@ -37,7 +69,9 @@ export default {
export default { export default {
data() { data() {
return { return {
value: '' value1: '',
value2: '',
value3: ''
} }
} }
} }
@ -46,10 +80,20 @@ export default {
`, `,
composition: ` composition: `
<template> <template>
<div class="card flex justify-center"> <div class="card flex justify-center items-end gap-4">
<FloatLabel> <FloatLabel>
<InputMask id="ssn" v-model="val2" mask="999-99-9999" placeholder="999-99-9999" /> <InputMask id="over_label" v-model="value1" mask="999-99-9999" />
<label for="ssn">SSN</label> <label for="over_label">Over Label</label>
</FloatLabel>
<FloatLabel variant="in">
<InputMask id="in_label" v-model="value2" mask="999-99-9999" />
<label for="in_label">In Label</label>
</FloatLabel>
<FloatLabel variant="on">
<InputMask id="on_label" v-model="value3" mask="999-99-9999" />
<label for="on_label">On Label</label>
</FloatLabel> </FloatLabel>
</div> </div>
</template> </template>
@ -57,7 +101,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('');
<\/script> <\/script>
` `
} }

View File

@ -0,0 +1,66 @@
<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>
<InputMask id="ssn" v-model="value" mask="999-99-9999" autocomplete="off" />
<label for="ssn">SSN</label>
</IftaLabel>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: null,
code: {
basic: `
<IftaLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" />
<label for="ssn">SSN</label>
</IftaLabel>
`,
options: `
<template>
<div class="card flex justify-center">
<IftaLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" />
<label for="ssn">SSN</label>
</IftaLabel>
</div>
</template>
<script setup>
export default {
data() {
return {
value: null
}
}
}
<\/script>
`,
composition: `
<template>
<div class="card flex justify-center">
<IftaLabel>
<InputMask id="ssn" v-model="value" mask="999-99-9999" />
<label for="ssn">SSN</label>
</IftaLabel>
</div>
</template>
<script setup>
import { ref } from 'vue';
const value = ref(null);
<\/script>
`
}
};
}
};
</script>

View File

@ -16,6 +16,7 @@ import BasicDoc from '@/doc/inputmask/BasicDoc.vue';
import DisabledDoc from '@/doc/inputmask/DisabledDoc.vue'; import DisabledDoc from '@/doc/inputmask/DisabledDoc.vue';
import FilledDoc from '@/doc/inputmask/FilledDoc.vue'; import FilledDoc from '@/doc/inputmask/FilledDoc.vue';
import FloatLabelDoc from '@/doc/inputmask/FloatLabelDoc.vue'; import FloatLabelDoc from '@/doc/inputmask/FloatLabelDoc.vue';
import IftaLabelDoc from '@/doc/inputmask/IftaLabelDoc.vue';
import ImportDoc from '@/doc/inputmask/ImportDoc.vue'; import ImportDoc from '@/doc/inputmask/ImportDoc.vue';
import InvalidDoc from '@/doc/inputmask/InvalidDoc.vue'; import InvalidDoc from '@/doc/inputmask/InvalidDoc.vue';
import MaskDoc from '@/doc/inputmask/MaskDoc.vue'; import MaskDoc from '@/doc/inputmask/MaskDoc.vue';
@ -58,6 +59,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',