webpackJsonp([11],{288:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=window.exparser.registerElement({is:"wx-picker",template:'<div id="wrapper"><slot></slot></div>',behaviors:["wx-base","wx-data-Component"],properties:{range:{type:Array,value:[],public:!0},value:{type:String,value:"",public:!0},mode:{type:String,value:"selector",public:!0},fields:{type:String,value:"day",public:!0},start:{type:String,value:"",public:!0},end:{type:String,value:"",public:!0},disabled:{type:Boolean,value:!1,public:!0},rangeKey:{type:String,value:"",public:!0}},listeners:{"wrapper.tap":"showPickerView"},resetFormData:function(){"selector"==this.mode?this.value=-1:this.value=""},getFormData:function(e){this.__pickerShow?this.__formCallback=e:"function"==typeof e&&e(this.value)},formGetDataCallback:function(){"function"==typeof this.__formCallback&&this.__formCallback(this.value),this.__formCallback=void 0},showPickerView:function(){"date"==this.mode||"time"==this.mode?this.showDatePickerView():"selector"===this.mode&&this.showSelector()},getCustomerStyle:function(){var e=this.$.wrapper.getBoundingClientRect();return{width:e.width,height:e.height,left:e.left+window.scrollX,top:e.top+window.scrollY}},showSelector:function(e){var t=this;if(!this.disabled){var i=parseInt(this.value);(isNaN(i)||i>=this.range.length)&&(i=0);var r=[];if(this.rangeKey)for(var a=0;a<this.range.length;a++){var s=this.range[a];r.push(s[this.rangeKey]+"")}else for(var l=0;l<this.range.length;l++)r.push(this.range[l]+"");WeixinJSBridge.invoke("showPickerView",{array:r,current:i,style:this.getCustomerStyle()},function(e){/:ok/.test(e.errMsg)&&(t.value=e.index,t.triggerEvent("change",{value:t.value})),t.resetPickerState(),t.formGetDataCallback()}),this.__pickerShow=!0}},showDatePickerView:function(){var e=this;this.disabled||(WeixinJSBridge.invoke("showDatePickerView",{range:{start:this.start,end:this.end},mode:this.mode,current:this.value,fields:this.fields,style:this.getCustomerStyle()},function(t){/:ok/.test(t.errMsg)&&(e.value=t.value,e.triggerEvent("change",{value:e.value})),e.resetPickerState(),e.formGetDataCallback()}),this.__pickerShow=!0)},resetPickerState:function(){this.__pickerShow=!1}})}});