Files
leadchat/app/javascript/dashboard/components/widgets/forms/Input.vue
Sivin Varghese 7b2b3ac37d feat(V5): Update settings pages UI (#13396)
# Pull Request Template

## Description

This PR updates settings page UI


## Type of change

- [x] New feature (non-breaking change which adds functionality)


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2026-02-19 15:04:40 +05:30

91 lines
1.8 KiB
Vue

<script>
/**
* @deprecated This component is deprecated and will be removed in the next major version.
* Please use v3/components/Form/Input.vue instead
*/
export default {
props: {
label: {
type: String,
default: '',
},
modelValue: {
type: [String, Number],
default: '',
},
type: {
type: String,
default: 'text',
},
placeholder: {
type: String,
default: '',
},
helpText: {
type: String,
default: '',
},
error: {
type: String,
default: '',
},
readonly: {
type: Boolean,
default: false,
},
styles: {
type: Object,
default: () => {},
},
},
emits: ['update:modelValue', 'input', 'blur'],
mounted() {
if (import.meta.env.DEV) {
// eslint-disable-next-line no-console
console.warn(
'[DEPRECATED] <WootInput> has be deprecated and will be removed soon. Please use v3/components/Form/Input.vue instead'
);
}
},
methods: {
onChange(e) {
this.$emit('input', e.target.value);
this.$emit('update:modelValue', e.target.value);
},
onBlur(e) {
this.$emit('blur', e.target.value);
},
},
};
</script>
<template>
<label class="input-container">
<span v-if="label" class="text-heading-3">{{ label }}</span>
<input
:value="modelValue"
:type="type"
:placeholder="placeholder"
:readonly="readonly"
:style="styles"
@input="onChange"
@blur="onBlur"
/>
<p v-if="helpText" class="help-text text-label-small">{{ helpText }}</p>
<span v-if="error" class="message">
{{ error }}
</span>
<slot name="masked" />
</label>
</template>
<style scoped lang="scss">
.help-text {
@apply mt-0.5 not-italic text-n-slate-11;
}
.message {
margin-top: 0 !important;
}
</style>