@cloudron/pankow 3.5.15 → 3.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MaskedInput.vue +2 -12
- package/package.json +1 -1
|
@@ -5,10 +5,6 @@ import { computed } from 'vue';
|
|
|
5
5
|
const model = defineModel({ type: [String, null], default: null });
|
|
6
6
|
|
|
7
7
|
const props = defineProps({
|
|
8
|
-
required: {
|
|
9
|
-
type: Boolean,
|
|
10
|
-
default: false,
|
|
11
|
-
},
|
|
12
8
|
multiline: {
|
|
13
9
|
type: Boolean,
|
|
14
10
|
default: false
|
|
@@ -27,20 +23,14 @@ const displayValue = computed({
|
|
|
27
23
|
},
|
|
28
24
|
});
|
|
29
25
|
|
|
30
|
-
const isValid = computed(() => {
|
|
31
|
-
if (!props.required) return false;
|
|
32
|
-
if (model.value === null) return true; // treat masked as satisfying "required"
|
|
33
|
-
return !!model.value;
|
|
34
|
-
});
|
|
35
|
-
|
|
36
26
|
</script>
|
|
37
27
|
|
|
38
28
|
<template>
|
|
39
29
|
<template v-if="!multiline">
|
|
40
|
-
<input class="pankow-masked-input" :value="displayValue"
|
|
30
|
+
<input class="pankow-masked-input" :value="displayValue" @input="displayValue = $event.target.value" @focus="$event.target.select()" />
|
|
41
31
|
</template>
|
|
42
32
|
<template v-else>
|
|
43
|
-
<textarea :
|
|
33
|
+
<textarea :value="displayValue" @input="displayValue = $event.target.value" @focus="$event.target.select()"></textarea>
|
|
44
34
|
</template>
|
|
45
35
|
</template>
|
|
46
36
|
|