<template>

    <label class="form_elemen">
        <slot></slot>
        <textarea :rows="rows" :value="modelValue" @input="updateInput" class="input" :placeholder="placeholder"  :disabled="disableInput" />
    </label>

</template>

<script>
import {mapState} from 'vuex';
export default {
    name: 'MyTextarea',
    props:{
        modelValue:[String,Number],
        placeholder:String,
        rows: {type:Number,default:5},
    },

    computed: {
        ...mapState({
            disableInput: state=>state.disableInput,
        }),
    },

    methods:{
        updateInput(event){
            this.$emit('update:modelValue',event.target.value)

        },


    },




}
</script>

<style scoped>


.form_elemen{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    white-space:nowrap;
    gap:5px;
}






.input {


    /*resize: none;*/

    overflow: hidden;


    min-height: 33px;



    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;


    color: #444;
    line-height: 15px;
    padding: .5em .3em .4em .3em;
    width: 100%;

    box-sizing: border-box;
    margin: 0;

    box-shadow: 0 1px 0 1px rgba(196, 190, 190, 0.04);
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;


}
.input:focus{
    box-shadow: 0 0 1px 2px rgba(59, 153, 252, .7);
    /*box-shadow: 0 0 0 3px -moz-mac-focusring;*/
    color: #222;
    outline: none;
}
.input:hover{
    border-color: #888;
}


</style>