Label support for InputNumber
parent
4033c34309
commit
4d0ada54b5
|
@ -2,10 +2,20 @@
|
|||
<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>
|
||||
</DocSectionText>
|
||||
<div class="card flex justify-center">
|
||||
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||
<FloatLabel>
|
||||
<InputNumber id="number-input" v-model="value" />
|
||||
<label for="number-input">Number</label>
|
||||
<InputNumber v-model="value1" inputId="over_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="over_label">Over Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="in">
|
||||
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="in_label">In Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="on">
|
||||
<InputNumber v-model="value3" inputId="on_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="on_label">On Label</label>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
|
@ -15,20 +25,42 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: null,
|
||||
value1: null,
|
||||
value2: null,
|
||||
value3: null,
|
||||
code: {
|
||||
basic: `
|
||||
<FloatLabel>
|
||||
<InputNumber id="number-input" v-model="value" />
|
||||
<label for="number-input">Number</label>
|
||||
<InputNumber v-model="value1" inputId="over_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="over_label">Over Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="in">
|
||||
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="in_label">In Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="on">
|
||||
<InputNumber v-model="value3" inputId="on_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="on_label">On Label</label>
|
||||
</FloatLabel>
|
||||
`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-center">
|
||||
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||
<FloatLabel>
|
||||
<InputNumber id="number-input" v-model="value" />
|
||||
<label for="number-input">Number</label>
|
||||
<InputNumber v-model="value1" inputId="over_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="over_label">Over Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="in">
|
||||
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="in_label">In Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="on">
|
||||
<InputNumber v-model="value3" inputId="on_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="on_label">On Label</label>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -37,7 +69,9 @@ export default {
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: null
|
||||
value1: null,
|
||||
value2: null,
|
||||
value3: null
|
||||
};
|
||||
}
|
||||
};
|
||||
|
@ -45,10 +79,20 @@ export default {
|
|||
`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card flex justify-center">
|
||||
<div class="card flex flex-wrap justify-center items-end gap-4">
|
||||
<FloatLabel>
|
||||
<InputNumber id="number-input" v-model="value" />
|
||||
<label for="number-input">Number</label>
|
||||
<InputNumber v-model="value1" inputId="over_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="over_label">Over Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="in">
|
||||
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="in_label">In Label</label>
|
||||
</FloatLabel>
|
||||
|
||||
<FloatLabel variant="on">
|
||||
<InputNumber v-model="value3" inputId="on_label" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="on_label">On Label</label>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -56,7 +100,9 @@ export default {
|
|||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const value = ref();
|
||||
const value1 = ref(null);
|
||||
const value2 = ref(null);
|
||||
const value3 = ref(null);
|
||||
<\/script>
|
||||
`
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="price_input">Price</label>
|
||||
</IftaLabel>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 1,
|
||||
code: {
|
||||
basic: `
|
||||
<IftaLabel>
|
||||
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="price_input">Price</label>
|
||||
</IftaLabel>
|
||||
`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-center">
|
||||
<IftaLabel>
|
||||
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="price_input">Price</label>
|
||||
</IftaLabel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 1
|
||||
};
|
||||
}
|
||||
};
|
||||
<\/script>
|
||||
`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card flex justify-center">
|
||||
<IftaLabel>
|
||||
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" />
|
||||
<label for="price_input">Price</label>
|
||||
</IftaLabel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const value = ref(1);
|
||||
<\/script>
|
||||
`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -17,6 +17,7 @@ import CurrencyDoc from '@/doc/inputnumber/CurrencyDoc.vue';
|
|||
import DisabledDoc from '@/doc/inputnumber/DisabledDoc.vue';
|
||||
import FilledDoc from '@/doc/inputnumber/FilledDoc.vue';
|
||||
import FloatLabelDoc from '@/doc/inputnumber/FloatLabelDoc.vue';
|
||||
import IftaLabelDoc from '@/doc/inputnumber/IftaLabelDoc.vue';
|
||||
import ImportDoc from '@/doc/inputnumber/ImportDoc.vue';
|
||||
import InvalidDoc from '@/doc/inputnumber/InvalidDoc.vue';
|
||||
import LocaleDoc from '@/doc/inputnumber/LocaleDoc.vue';
|
||||
|
@ -70,6 +71,11 @@ export default {
|
|||
label: 'Float Label',
|
||||
component: FloatLabelDoc
|
||||
},
|
||||
{
|
||||
id: 'iftalabel',
|
||||
label: 'Ifta Label',
|
||||
component: IftaLabelDoc
|
||||
},
|
||||
{
|
||||
id: 'filled',
|
||||
label: 'Filled',
|
||||
|
|
Loading…
Reference in New Issue