webpackJsonp([6],{302:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=window.exparser.registerElement({is:"wx-slider",template:'\n    <div class="wx-slider-wrapper" class.wx-slider-disabled="{{disabled}}">\n      <div class="wx-slider-tap-area" id="wrapper">\n        <div class="wx-slider-handle-wrapper" style.background-color="{{color}}">\n          <div class="wx-slider-handle" style.left="{{_getValueWidth(value,min,max)}}" id="handle"></div>\n          <div class="wx-slider-track" style.width="{{_getValueWidth(value,min,max)}}" style.background-color="{{selectedColor}}"></div>\n          <div class="wx-slider-step" id="step"></div>\n        </div>\n      </div>\n      <span hidden$="{{!showValue}}" class="wx-slider-value">\n        <p parse-text-content>{{value}}</p>\n      </span>\n    </div>\n  ',properties:{min:{type:Number,value:0,public:!0,observer:"_revalicateRange"},max:{type:Number,value:100,public:!0,observer:"_revalicateRange"},step:{type:Number,value:1,public:!0},value:{type:Number,value:0,public:!0,coerce:"_filterValue"},showValue:{type:Boolean,value:!1,public:!0},color:{type:String,value:"#e9e9e9"},selectedColor:{type:String,value:"#1aad19"}},listeners:{"wrapper.tap":"_onTap"},behaviors:["wx-base","wx-data-Component","wx-disabled","wx-touchtrack"],created:function(){this.touchtrack(this.$.handle,"_onTrack")},_filterValue:function(e){return e<this.min?this.min:e>this.max?this.max:Math.round((e-this.min)/this.step)*this.step+this.min},_revalicateRange:function(){this.value=this._filterValue(this.value)},_getValueWidth:function(e,t,i){return 100*(e-t)/(i-t)+"%"},_getXPosition:function(e){for(var t=e.offsetLeft;e;e=e.offsetParent)t+=e.offsetLeft;return t-document.body.scrollLeft},_onUserChangedValue:function(e){var t=this.$.step.offsetWidth,i=this._getXPosition(this.$.step),a=(e.detail.x-i)*(this.max-this.min)/t+this.min;a=this._filterValue(a),this.value=a},_onTrack:function(e){if(!this.disabled)return"move"===e.detail.state?(this._onUserChangedValue(e),!1):void("end"===e.detail.state&&this.triggerEvent("change",{value:this.value}))},_onTap:function(e){this.disabled||(this._onUserChangedValue(e),this.triggerEvent("change",{value:this.value}))},resetFormData:function(){this.value=this.min}})}});