export default {
  name: 'BaseSearchOrder',
  components: {},
  model: {
    prop: 'value',
    event: 'change',
  },
  data() {
    return {
      inputValue: '',
      sameInput: '',
      loader: false,
    };
  },
  methods: {
    clearInput(){
      this.inputValue = '';
  
      if(this.sameInput){  
        this.sameInput = this.inputValue;
        this.$emit('callbacksearch', this.inputValue, true, true);
      } 
    },
    searchInput(){
      if(!this.inputValue || (this.inputValue === this.sameInput)){
        return;
      }
      this.$emit('callbacksearch', this.inputValue, true, false);
      this.sameInput = this.inputValue;
    },
    loaderInput(value){
      this.loader = value;
    }
  },
  watch:{
    inputValue(){
      this.$emit('change', this.inputValue);
    },
  },
  mounted() {
  },
  updated(){
    this.inputValue = this.inputValue;
  }
};
