Demo updates for InputNumber

pull/6501/head
Cagatay Civici 2024-09-30 10:24:04 +03:00
parent bef6b39091
commit e2687f3aaf
4 changed files with 30 additions and 23 deletions

View File

@ -9,7 +9,7 @@
</FloatLabel> </FloatLabel>
<FloatLabel variant="in"> <FloatLabel variant="in">
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="in_label">In Label</label> <label for="in_label">In Label</label>
</FloatLabel> </FloatLabel>
@ -36,7 +36,7 @@ export default {
</FloatLabel> </FloatLabel>
<FloatLabel variant="in"> <FloatLabel variant="in">
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="in_label">In Label</label> <label for="in_label">In Label</label>
</FloatLabel> </FloatLabel>
@ -54,7 +54,7 @@ export default {
</FloatLabel> </FloatLabel>
<FloatLabel variant="in"> <FloatLabel variant="in">
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="in_label">In Label</label> <label for="in_label">In Label</label>
</FloatLabel> </FloatLabel>
@ -86,7 +86,7 @@ export default {
</FloatLabel> </FloatLabel>
<FloatLabel variant="in"> <FloatLabel variant="in">
<InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="in_label">In Label</label> <label for="in_label">In Label</label>
</FloatLabel> </FloatLabel>

View File

@ -4,7 +4,7 @@
</DocSectionText> </DocSectionText>
<div class="card flex justify-center"> <div class="card flex justify-center">
<IftaLabel> <IftaLabel>
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="price_input">Price</label> <label for="price_input">Price</label>
</IftaLabel> </IftaLabel>
</div> </div>
@ -19,7 +19,7 @@ export default {
code: { code: {
basic: ` basic: `
<IftaLabel> <IftaLabel>
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="price_input">Price</label> <label for="price_input">Price</label>
</IftaLabel> </IftaLabel>
`, `,
@ -27,7 +27,7 @@ export default {
<template> <template>
<div class="card flex justify-center"> <div class="card flex justify-center">
<IftaLabel> <IftaLabel>
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="price_input">Price</label> <label for="price_input">Price</label>
</IftaLabel> </IftaLabel>
</div> </div>
@ -47,7 +47,7 @@ export default {
<template> <template>
<div class="card flex justify-center"> <div class="card flex justify-center">
<IftaLabel> <IftaLabel>
<InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" /> <InputNumber v-model="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" variant="filled" />
<label for="price_input">Price</label> <label for="price_input">Price</label>
</IftaLabel> </IftaLabel>
</div> </div>

View File

@ -2,8 +2,9 @@
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p>Invalid state is displayed using the <i>invalid</i> prop to indicate a failed validation. You can use this style when integrating with form validation libraries.</p> <p>Invalid state is displayed using the <i>invalid</i> prop to indicate a failed validation. You can use this style when integrating with form validation libraries.</p>
</DocSectionText> </DocSectionText>
<div class="card flex justify-center"> <div class="card flex flex-wrap justify-center gap-4">
<InputNumber v-model="value" :invalid="value === null" mode="decimal" :minFractionDigits="2" /> <InputNumber v-model="value1" :invalid="value1 === null" mode="decimal" :minFractionDigits="2" />
<InputNumber v-model="value2" :invalid="value2 === null" mode="decimal" :minFractionDigits="2" variant="filled" />
</div> </div>
<DocSectionCode :code="code" /> <DocSectionCode :code="code" />
</template> </template>
@ -12,15 +13,18 @@
export default { export default {
data() { data() {
return { return {
value: null, value1: null,
value2: null,
code: { code: {
basic: ` basic: `
<InputNumber v-model="value" :invalid="value === null" mode="decimal" :minFractionDigits="2" /> <InputNumber v-model="value1" :invalid="value1 === null" mode="decimal" :minFractionDigits="2" />
<InputNumber v-model="value2" :invalid="value2 === null" mode="decimal" :minFractionDigits="2" variant="filled" />
`, `,
options: ` options: `
<template> <template>
<div class="card flex justify-center"> <div class="card flex flex-wrap justify-center gap-4">
<InputNumber v-model="value" :invalid="value === null" mode="decimal" :minFractionDigits="2" /> <InputNumber v-model="value1" :invalid="value1 === null" mode="decimal" :minFractionDigits="2" />
<InputNumber v-model="value2" :invalid="value2 === null" mode="decimal" :minFractionDigits="2" variant="filled" />
</div> </div>
</template> </template>
@ -28,7 +32,8 @@ export default {
export default { export default {
data() { data() {
return { return {
value: null value1: null,
value2: null
} }
} }
} }
@ -36,15 +41,17 @@ export default {
`, `,
composition: ` composition: `
<template> <template>
<div class="card flex justify-center"> <div class="card flex flex-wrap justify-center gap-4">
<InputNumber v-model="value" :invalid="value === null" mode="decimal" :minFractionDigits="2" /> <InputNumber v-model="value1" :invalid="value1 === null" mode="decimal" :minFractionDigits="2" />
<InputNumber v-model="value2" :invalid="value2 === null" mode="decimal" :minFractionDigits="2" variant="filled" />
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
const value = ref(); const value1 = ref(null);
const value2 = ref(null);
<\/script> <\/script>
` `
} }

View File

@ -66,6 +66,11 @@ export default {
label: 'Vertical', label: 'Vertical',
component: VerticalDoc component: VerticalDoc
}, },
{
id: 'filled',
label: 'Filled',
component: FilledDoc
},
{ {
id: 'floatlabel', id: 'floatlabel',
label: 'Float Label', label: 'Float Label',
@ -76,11 +81,6 @@ export default {
label: 'Ifta Label', label: 'Ifta Label',
component: IftaLabelDoc component: IftaLabelDoc
}, },
{
id: 'filled',
label: 'Filled',
component: FilledDoc
},
{ {
id: 'invalid', id: 'invalid',
label: 'Invalid', label: 'Invalid',