2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-11 18:02:27 +03:00

New version code prepare

This commit is contained in:
Alexander Shabunevich
2022-12-04 16:50:18 +03:00
parent fadf78f5bb
commit 31c286bb6b
48 changed files with 15195 additions and 5502 deletions
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { MaskaDetail, vMaska } from '../../src'
const binded = reactive<Partial<MaskaDetail>>({})
</script>
<template>
<input v-maska="binded" data-maska="#-#" value="123" />
<div>{{ binded.masked }}</div>
</template>
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { MaskaDetail, vMaska } from '../../src'
const binded = reactive<Partial<MaskaDetail>>({})
</script>
<template>
<input v-maska="binded" data-maska="#-#" />
<div>{{ binded.masked }}</div>
</template>
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { MaskaDetail, vMaska } from '../../src'
const binded = reactive<Partial<MaskaDetail>>({})
</script>
<template>
<input v-maska="binded" data-maska="#-#" />
<div>{{ binded.unmasked }}</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { MaskaDetail, vMaska } from '../../src'
const binded = reactive<Partial<MaskaDetail>>({})
</script>
<template>
<input v-maska="binded" data-maska="#-#-#" />
<div v-if="binded.completed">Completed</div>
<div v-else>Uncompleted</div>
</template>
+21
View File
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { vMaska, MaskaDetail, MaskInputOptions } from '../../src'
const binded = reactive<Partial<MaskaDetail>>({})
const config = reactive<MaskInputOptions>({
mask: 'A A',
tokens: {
A: {
pattern: /[A-Z]/,
multiple: true,
transform: (chr) => chr.toUpperCase()
}
}
})
</script>
<template>
<input v-maska:[config]="binded" />
<div>{{ binded.masked }}</div>
</template>
+7
View File
@@ -0,0 +1,7 @@
<script setup lang="ts">
import { vMaska } from '../../src'
</script>
<template>
<input v-maska data-maska="#-#" data-maska-eager />
</template>
+10
View File
@@ -0,0 +1,10 @@
<script setup lang="ts">
import { ref } from 'vue'
import { vMaska } from '../../src'
const mask = ref('["#--#", "#-#--#"]')
</script>
<template>
<input v-maska :data-maska="mask" />
</template>
+13
View File
@@ -0,0 +1,13 @@
<script setup lang="ts">
import { MaskaDetail, vMaska } from '../../src'
const emit = defineEmits(['mask'])
const onMaska = (e: CustomEvent<MaskaDetail>) => {
emit('mask', e.detail)
}
</script>
<template>
<input v-maska data-maska="#-#" @maska="onMaska" />
</template>
+12
View File
@@ -0,0 +1,12 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { MaskInputOptions, vMaska } from '../../src'
const config = reactive<MaskInputOptions>({
preProcess: (val) => val.toUpperCase()
})
</script>
<template>
<input v-maska:[config] data-maska="A A" data-maska-tokens="A:[A-Z]:multiple" />
</template>
+21
View File
@@ -0,0 +1,21 @@
<script lang="ts">
import { vMaska } from '../../src'
export default {
data() {
return {
binded: {
masked: ''
}
}
},
directives: {
maska: vMaska
}
}
</script>
<template>
<input v-maska="binded" data-maska="#-#" />
<div>{{ binded.masked }}</div>
</template>
+7
View File
@@ -0,0 +1,7 @@
<script setup lang="ts">
import { vMaska } from '../../src'
</script>
<template>
<input v-maska data-maska="#-#" />
</template>