(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{746:function(e,t,n){"use strict";n.r(t);n(171),n(70);var r={props:{value:[String,Number],debounce:{type:Number,default:100},disabled:Boolean,required:Boolean,maxlength:[Number,String],name:String,placeholder:String,readonly:Boolean},data:function(){return{timeout:0}},watch:{value:function(){this.updateValues()},disabled:function(){this.setParentDisabled()},required:function(){this.setParentRequired()},placeholder:function(){this.setParentPlaceholder()},maxlength:function(){this.handleMaxLength()}},methods:{handleMaxLength:function(){this.parentContainer.enableCounter=this.maxlength>0,this.parentContainer.counterLength=this.maxlength},lazyEventEmitter:function(){var e=this;this.timeout&&window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){e.$emit("change",e.$el.value),e.$emit("input",e.$el.value)}),this.debounce)},setParentValue:function(e){this.parentContainer.setValue(e||this.$el.value)},setParentDisabled:function(){this.parentContainer.isDisabled=this.disabled},setParentRequired:function(){this.parentContainer.isRequired=this.required},setParentPlaceholder:function(){this.parentContainer.hasPlaceholder=!!this.placeholder},updateValues:function(){var e=this;this.$nextTick((function(){var t=e.$el.value||e.value;e.setParentValue(t),e.parentContainer.inputLength=t?t.length:0}))},onFocus:function(e){this.parentContainer&&(this.parentContainer.isFocused=!0),this.$emit("focus",this.$el.value,e)},onBlur:function(e){this.parentContainer.isFocused=!1,this.setParentValue(),this.$emit("blur",this.$el.value,e)},onInput:function(){this.updateValues(),this.lazyEventEmitter()}}},o=function e(t,n){return!(!t||!t.$el)&&(0!==t._uid&&(t.$el.classList.contains(n)?t:e(t.$parent,n)))},l={mixins:[r],props:{type:{type:String,default:"text"}},mounted:function(){var e=this;this.$nextTick((function(){if(e.parentContainer=o(e.$parent,"re-input-container"),!e.parentContainer)throw e.$destroy(),new Error("You should wrap the re-input in a re-input-container");e.parentContainer.inputInstance=e,e.setParentDisabled(),e.setParentRequired(),e.setParentPlaceholder(),e.handleMaxLength(),e.updateValues()}))}},h=n(46),component=Object(h.a)(l,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("input",{staticClass:"re-input",attrs:{type:e.type,name:e.name,disabled:e.disabled,required:e.required,placeholder:e.placeholder,maxlength:e.maxlength,readonly:e.readonly},domProps:{value:e.value},on:{focus:e.onFocus,blur:e.onBlur,input:e.onInput,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:e.onInput.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:e.onInput.apply(null,arguments)}]}})}),[],!1,null,null,null);t.default=component.exports}}]);