1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
![]() |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d2732ba"],{"0a1b":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("92fa"),n=w(r),i=a("41b2"),s=w(i),o=a("6042"),l=w(o);t.fixControlledValue=C,t.resolveOnChange=T,t.getInputClassName=z;var u=a("4d26"),d=w(u),f=a("516f"),c=w(f),p=a("0464"),h=w(p),m=a("8bc7"),v=w(m),b=a("73c8"),g=a("bad7"),y=a("1fde"),x=w(y);function w(e){return e&&e.__esModule?e:{default:e}}function $(){}function C(e){return"undefined"===typeof e||null===e?"":e}function T(e,t,a){if(a){var r=t;if("click"===t.type){Object.defineProperty(r,"target",{writable:!0}),Object.defineProperty(r,"currentTarget",{writable:!0}),r.target=e,r.currentTarget=e;var n=e.value;return e.value="",a(r),void(e.value=n)}a(r)}}function z(e,t,a){var r;return(0,d["default"])(e,(r={},(0,l["default"])(r,e+"-sm","small"===t),(0,l["default"])(r,e+"-lg","large"===t),(0,l["default"])(r,e+"-disabled",a),r))}t["default"]={name:"AInput",inheritAttrs:!1,model:{prop:"value",event:"change.value"},props:(0,s["default"])({},v["default"]),inject:{configProvider:{default:function(){return g.ConfigConsumerProps}}},data:function(){var e=this.$props,t="undefined"===typeof e.value?e.defaultValue:e.value;return{stateValue:"undefined"===typeof t?"":t}},watch:{value:function(e){this.stateValue=e}},mounted:function(){var e=this;this.$nextTick((function(){e.autoFocus&&e.focus(),e.clearPasswordValueAttribute()}))},beforeDestroy:function(){this.removePasswordTimeout&&clearTimeout(this.removePasswordTimeout)},methods:{onBlur:function(e){this.$forceUpdate();var t=(0,b.getListeners)(this),a=t.blur;a&&a(e)},focus:function(){this.$refs.input.focus()},blur:function(){this.$refs.input.blur()},select:function(){this.$refs.input.select()},setValue:function(e,t){this.stateValue!==e&&((0,b.hasProp)(this,"value")||(this.stateValue=e,this.$nextTick((function(){t&&t()}))))},onChange:function(e){this.$emit("change.value",e.target.value),this.$emit("change",e),this.$emit("input",e)},handleReset:function(e){var t=this;this.setValue("",(function(){t.focus()})),T(this.$refs.input,e,this.onChange)},renderInput:function(e){var t=this.$createElement,a=(0,h["default"])(this.$props,["prefixCls","addonBefore","addonAfter","prefix","suffix","allowClear","value","defaultValue","lazy","size","inputType","className"]),r=this.stateValue,n=this.handleKeyDown,i=this.handleChange,o=this.size,l=this.disabled,u={directives:[{name:"ant-input"}],domProps:{value:C(r)},attrs:(0,s["default"])({},a,this.$attrs),on:(0,s["default"])({},(0,b.getListeners)(this),{keydown:n,input:i,change:$,blur:this.onBlur}),class:z(e,o,l),ref:"input",key:"ant-input"};return t("input",u)},clearPasswordValueAttribute:function(){var e=this;this.removePasswordTimeout=setTimeout((function(){e.$refs.input&&e.$refs.input.getAttribute&&"password"===e.$refs.input.getAttribute("type")&&e.$refs.input.hasAttribute("value")&&e.$refs.input.removeAttribute("value")}))},handleChange:function(e){var t=e.target,a=t.value,r=t.composing;(e.isComposing||r)&&this.lazy||this.stateValue===a||(this.setValue(a,this.clearPasswordValueAttribute),T(this.$refs.input,e,this.onChange))},handleKeyDown:function(e){13===e.keyCode&&this.$emit("pressEnter",e),this.$emit("keydown",e)}},render:function(){var e=arguments[0];if("textarea"===this.$props.type){var t={props:this.$props,attrs:this.$attrs,on:(0,s["default"])({},(0,b.getListeners)(this),{input:this.handleChange,keydown:this.handleKeyDown,change:$,blur:this.onBlur})};return e(c["default"],(0,n["default"])([t,{ref:"input"}]))}var a=this.$props.prefixCls,r=this.$data.stateValue,i=this.configProvider.getPrefixCls,o=i("input",a),l=(0,b.getComponentFromProp)(this,"addonAfter"),u=(0,b.getComponentFromProp)(this,"addonBefore"),d=(0,b.getComponentFromProp)(this,"suffix"),f=(0,b.getComponentFromProp)(this,"prefix"),p={props:(0,s["default"])({},(0,b.getOptionProps)(this),{prefixCls:o,inputType:"input",value:C(r),element:this.renderInput(o),handleReset:this.handleReset,addonAfter:l,addonBefore:u,suffix:d,prefix:f}),on:(0,b.getListeners)(this)};return e(x["de
|