File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
plugin/widgets/inputs/input-text Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1010 <input-field name = " username" label = " Error array" :errors = " ['Some mistake', 'Length more then 5']" />
1111 <input-field name = " username" label = " Prefix" prefix = " Login:" />
1212 <input-field name = " username" label = " Placeholder" placeholder = " Write something" />
13-
13+ < input-field name = " username " label = " Numeric " numeric />
1414 <h2 >Input Textarea</h2 >
1515 <input-field name = " description" type = " textarea" />
1616 <input-field name = " description" type = " textarea" label = " With label" />
Original file line number Diff line number Diff line change 1212 ref =" refInput"
1313 class =" vf-input_clean input-text"
1414 type =" text"
15- :value =" pretty(modelValue)"
15+ :value =" isFocused ? modelValue : pretty ? pretty (modelValue) : modelValue "
1616 :disabled =" disabled"
1717 :autofocus =" autofocus"
1818 :placeholder =" placeholder"
1919 @input =" onInput($event.target.value)"
20+ @focusin = " isFocused = true"
21+ @focusout = " isFocused = false"
2022 >
2123 </div >
2224 </input-wrap >
@@ -47,13 +49,14 @@ const props = withDefaults(defineProps<{
4749 pretty : (a : string ) => a ,
4850})
4951
52+ const isFocused = ref (false );
5053const refInput = ref <HTMLInputElement >(props .modelValue );
5154const emit = defineEmits <{
5255 (e : ' update:modelValue' , value : any ): void
5356}>()
5457
5558function onlyNumber(a : string ) {
56- return a .replace (/ [^ 0-9 , ] / ,' ' )
59+ return a .replace (/ [^ \d , . +- ] / ,' ' )
5760}
5861
5962/**
You can’t perform that action at this time.
0 commit comments