export default {
    props: {
        fieldValue: { type: String, required: false },
        fieldRows: {type: Number, required: false, default: 3},
        id: { type: String, required: false },
        placeholder: {type: String, required: false, default: ''}
    },
    methods: {
        keyupHandler: function (e) {

            if (e && e.target && e.target.value)
                e.target.value = e.target.value.replace(/[\<\>]+/g, '');

            if (this.fieldDataType && this.fieldDataType != '' && this.fieldDataType.toLowerCase() == 'number' && e && e.target && e.target.value)
                e.target.value = e.target.value.replace(/[^0-9]/g, '');
        }
    },
    template: `
        <div class="form-group">
                   <textarea type="text" :value="fieldValue" :rows="fieldRows" @keyup='keyupHandler' @input="$emit('update:fieldValue', $event.target.value)" :placeholder="placeholder"></textarea>                                            
        </div>
`
}
