primevue-mirror/apps/showcase/doc/inputmask/MaskDoc.vue

117 lines
3.7 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
Mask format can be a combination of the following definitions; <i>a</i> for alphabetic characters, <i>9</i> for numeric characters and <i>*</i> for alphanumberic characters. In addition, formatting characters like <i>(</i>, <i>)</i> ,
<i>-</i> are also accepted.
</p>
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card p-fluid flex flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="ssn" class="font-bold block mb-2">SSN</label>
2023-02-28 08:29:30 +00:00
<InputMask id="ssn" v-model="value1" mask="999-99-9999" placeholder="999-99-9999" />
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="phone" class="font-bold block mb-2">Phone</label>
2023-03-16 12:57:25 +00:00
<InputMask id="phone" v-model="value2" mask="(999) 999-9999" placeholder="(999) 999-9999" />
2023-02-28 08:29:30 +00:00
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="serial" class="font-bold block mb-2">Serial</label>
2023-02-28 08:29:30 +00:00
<InputMask id="serial" v-model="value3" mask="a*-999-a999" placeholder="a*-999-a999" />
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value1: '',
value2: '',
value3: '',
code: {
2023-09-22 12:54:14 +00:00
basic: `
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="ssn" class="font-bold block mb-2">SSN</label>
2023-02-28 08:29:30 +00:00
<InputMask id="ssn" v-model="value1" mask="999-99-9999" placeholder="999-99-9999" />
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="phone" class="font-bold block mb-2">Phone</label>
<InputMask id="phone" v-model="value2" mask="(999) 999-9999" placeholder="(999) 999-9999" />
2023-02-28 08:29:30 +00:00
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="serial" class="font-bold block mb-2">Serial</label>
2023-02-28 08:29:30 +00:00
<InputMask id="serial" v-model="value3" mask="a*-999-a999" placeholder="a*-999-a999" />
2023-10-15 09:38:39 +00:00
</div>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card p-fluid flex flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="ssn" class="font-bold block mb-2">SSN</label>
2023-02-28 08:29:30 +00:00
<InputMask id="ssn" v-model="value1" mask="999-99-9999" placeholder="999-99-9999" />
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="phone" class="font-bold block mb-2">Phone</label>
<InputMask id="phone" v-model="value2" mask="(999) 999-9999" placeholder="(999) 999-9999" />
2023-02-28 08:29:30 +00:00
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="serial" class="font-bold block mb-2">Serial</label>
<InputMask id="serial" v-model="value3" mask="a*-999-a999" placeholder="a*-999-a999" />
2023-02-28 08:29:30 +00:00
</div>
</div>
</template>
<script>
export default {
data() {
return {
value1: '',
value2: '',
value3: ''
}
}
}
<\/script>
2023-11-28 13:06:32 +00:00
2023-10-15 09:38:39 +00:00
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card p-fluid flex flex-wrap gap-4">
2023-02-28 08:29:30 +00:00
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="ssn" class="font-bold block mb-2">SSN</label>
2023-02-28 08:29:30 +00:00
<InputMask id="ssn" v-model="value1" mask="999-99-9999" placeholder="999-99-9999" />
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="phone" class="font-bold block mb-2">Phone</label>
<InputMask id="phone" v-model="value2" mask="(999) 999-9999" placeholder="(999) 999-9999" />
2023-02-28 08:29:30 +00:00
</div>
<div class="flex-auto">
2023-11-28 13:06:32 +00:00
<label for="serial" class="font-bold block mb-2">Serial</label>
2023-02-28 08:29:30 +00:00
<InputMask id="serial" v-model="value3" mask="a*-999-a999" placeholder="a*-999-a999" />
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref('');
const value2 = ref('');
const value3 = ref('');
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>