fix: emit events across the app (#10227)

This PR makes the following changes

1. Update v-model bindings for components using the old `value` prop and `input` event method
2. Remove components that were not used anywhere

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Shivam Mishra
2024-10-04 20:33:41 +05:30
committed by GitHub
parent 88a16b8e96
commit 9338bc1391
13 changed files with 44 additions and 354 deletions

View File

@@ -21,7 +21,7 @@ export default {
type: String,
default: '',
},
value: {
modelValue: {
type: [String, Number],
default: '',
},
@@ -46,10 +46,10 @@ export default {
default: '',
},
},
emits: ['input', 'blur'],
emits: ['update:modelValue', 'blur'],
methods: {
onInput(e) {
this.$emit('input', e.target.value);
this.$emit('update:modelValue', e.target.value);
},
},
};
@@ -69,7 +69,7 @@ export default {
:required="required"
:placeholder="placeholder"
:data-testid="dataTestid"
:value="value"
:value="modelValue"
:rows="rows"
:class="{
'focus:outline-red-600 outline-red-600': hasError,
@@ -78,7 +78,7 @@ export default {
'resize-none': !allowResize,
}"
class="block w-full p-3 bg-white border-none rounded-md shadow-sm appearance-none outline outline-1 focus:outline focus:outline-2 text-slate-900 dark:text-slate-100 placeholder:text-slate-400 dark:bg-slate-800"
@input="onInput"
@update:model-value="onInput"
@blur="$emit('blur')"
/>
</WithLabel>