12 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[20,19,38],{535:function(t,n,e){"use strict";var o=e(2),r=e(27),l=e(10),h=e(5),path=e(320),c=e(4),f=e(119),d=e(13),v=e(217),m=e(58),w=e(118),y=e(319),E=e(3),k=e(96).f,D=e(59).f,P=e(28).f,N=e(536),x=e(321).trim,I="Number",$=h[I],L=path[I],T=$.prototype,_=h.TypeError,C=c("".slice),S=c("".charCodeAt),F=function(t){var n,e,o,r,l,h,c,code,f=y(t,"number");if(w(f))throw new _("Cannot convert a Symbol value to a number");if("string"==typeof f&&f.length>2)if(f=x(f),43===(n=S(f,0))||45===n){if(88===(e=S(f,2))||120===e)return NaN}else if(48===n){switch(S(f,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+f}for(h=(l=C(f,2)).length,c=0;c<h;c++)if((code=S(l,c))<48||code>r)return NaN;return parseInt(l,o)}return+f},A=f(I,!$(" 0o1")||!$("0b1")||$("+0x1")),X=function(t){var n,e=arguments.length<1?0:$(function(t){var n=y(t,"number");return"bigint"==typeof n?n:F(n)}(t));return m(T,n=this)&&E((function(){N(n)}))?v(Object(e),this,X):e};X.prototype=T,A&&!r&&(T.constructor=X),o({global:!0,constructor:!0,wrap:!0,forced:A},{Number:X});var Y=function(t,source){for(var n,e=l?k(source):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;e.length>o;o++)d(source,n=e[o])&&!d(t,n)&&P(t,n,D(source,n))};r&&L&&Y(path[I],L),(A||r)&&Y(path[I],$)},536:function(t,n,e){"use strict";var o=e(4);t.exports=o(1..valueOf)},537:function(t,n,e){"use strict";var o=e(2),r=e(4),l=e(80),h=e(536),c=e(322),f=e(3),d=RangeError,v=String,m=Math.floor,w=r(c),y=r("".slice),E=r(1..toFixed),k=function(t,n,e){return 0===n?e:n%2==1?k(t,n-1,e*t):k(t*t,n/2,e)},D=function(data,t,n){for(var e=-1,o=n;++e<6;)o+=t*data[e],data[e]=o%1e7,o=m(o/1e7)},P=function(data,t){for(var n=6,e=0;--n>=0;)e+=data[n],data[n]=m(e/t),e=e%t*1e7},N=function(data){for(var t=6,s="";--t>=0;)if(""!==s||0===t||0!==data[t]){var n=v(data[t]);s=""===s?n:s+w("0",7-n.length)+n}return s};o({target:"Number",proto:!0,forced:f((function(){return"0.000"!==E(8e-5,3)||"1"!==E(.9,0)||"1.25"!==E(1.255,2)||"1000000000000000128"!==E(0xde0b6b3a7640080,0)}))||!f((function(){E({})}))},{toFixed:function(t){var n,e,o,r,c=h(this),f=l(t),data=[0,0,0,0,0,0],m="",E="0";if(f<0||f>20)throw new d("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return v(c);if(c<0&&(m="-",c=-c),c>1e-21)if(e=(n=function(t){for(var n=0,e=t;e>=4096;)n+=12,e/=4096;for(;e>=2;)n+=1,e/=2;return n}(c*k(2,69,1))-69)<0?c*k(2,-n,1):c/k(2,n,1),e*=4503599627370496,(n=52-n)>0){for(D(data,0,e),o=f;o>=7;)D(data,1e7,0),o-=7;for(D(data,k(10,o,1),0),o=n-1;o>=23;)P(data,1<<23),o-=23;P(data,1<<o),D(data,1,1),P(data,2),E=N(data)}else D(data,0,e),D(data,1<<-n,0),E=N(data)+w("0",f);return E=f>0?m+((r=E.length)<=f?"0."+w("0",f-r)+E:y(E,0,r-f)+"."+y(E,r-f)):m+E}})},551:function(t,n,e){"use strict";var o=e(2),r=e(99).findIndex,l=e(218),h="findIndex",c=!0;h in[]&&Array(1)[h]((function(){c=!1})),o({target:"Array",proto:!0,forced:c},{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),l(h)},687:function(t,n,e){"use strict";e.r(n);e(551),e(60),e(535),e(537),e(48),e(66);var o={name:"ElSliderButton",components:{},props:{value:{type:Number,default:0},vertical:{type:Boolean,default:!1},tooltipClass:String,marks:Object},data:function(){return{hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:null,oldValue:this.value}},computed:{disabled:function(){return this.$parent.sliderDisabled},max:function(){return this.$parent.max},min:function(){return this.$parent.min},step:function(){return this.$parent.step},showTooltip:function(){return this.$parent.showTooltip},precision:function(){return this.$parent.precision},currentPosition:function(){var t=this;if(this.marks){var n=Object.keys(this.marks).map(Number),e=n.findIndex((function(i){return t.value<i}));if(-1===e)return"100%";var o=(e-1)/(n.length-1)+(this.value-n[e-1])/(n[e]-n[e-1])/(n.length-1);return o>1?"100%":"".concat(100*o,"%")}return"".concat((this.value-this.min)/(this.max-this.min)*100,"%")},enableFormat:function(){return this.$parent.formatTooltip instanceof Function},formatValue:function(){return this.enableFormat&&this.$parent.formatTooltip(this.value)||this.value},wrapperStyle:function(){return this.vertical?{bottom:this.currentPosition}:{left:this.currentPosition}}},watch:{dragging:function(t){this.$parent.dragging=t}},methods:{displayTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!0)},hideTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!1)},handleMouseEnter:function(){this.hovering=!0,this.displayTooltip()},handleMouseLeave:function(){this.hovering=!1,this.hideTooltip()},onButtonDown:function(t){this.disabled||(t.preventDefault(),this.onDragStart(t),window.addEventListener("mousemove",this.onDragging),window.addEventListener("touchmove",this.onDragging),window.addEventListener("mouseup",this.onDragEnd),window.addEventListener("touchend",this.onDragEnd),window.addEventListener("contextmenu",this.onDragEnd))},onLeftKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)-this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onRightKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)+this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onDragStart:function(t){this.dragging=!0,this.isClick=!0,"touchstart"===t.type&&(t.clientY=t.touches[0].clientY,t.clientX=t.touches[0].clientX),this.vertical?this.startY=t.clientY:this.startX=t.clientX,this.startPosition=parseFloat(this.currentPosition),this.newPosition=this.startPosition},onDragging:function(t){if(this.dragging){this.isClick=!1,this.displayTooltip(),this.$parent.resetSize();var n=0;"touchmove"===t.type&&(t.clientY=t.touches[0].clientY,t.clientX=t.touches[0].clientX),this.vertical?(this.currentY=t.clientY,n=(this.startY-this.currentY)/this.$parent.sliderSize*100):(this.currentX=t.clientX,n=(this.currentX-this.startX)/this.$parent.sliderSize*100),this.newPosition=this.startPosition+n,this.setPosition(this.newPosition)}},onDragEnd:function(){var t=this;this.dragging&&(setTimeout((function(){t.dragging=!1,t.hideTooltip(),t.isClick||(t.setPosition(t.newPosition),t.$parent.emitChange())}),0),window.removeEventListener("mousemove",this.onDragging),window.removeEventListener("touchmove",this.onDragging),window.removeEventListener("mouseup",this.onDragEnd),window.removeEventListener("touchend",this.onDragEnd),window.removeEventListener("contextmenu",this.onDragEnd))},setPosition:function(t){var n=this;if(null!==t&&!isNaN(t)){t<0?t=0:t>100&&(t=100);var e=100/((this.max-this.min)/this.step),o=Math.round(t/e)*e*(this.max-this.min)*.01+this.min;if(this.marks){var r=Object.keys(this.marks).map((function(t,n,e){return{value:Number(t),perc:100*n/(e.length-1)}}));if(100===t)o=r[r.length-1].value;else{var l=r.findIndex((function(n){return n.perc>t}));o=-1===l?r[r.length-2].value+(r.length-1)*((t-r[r.length-2].perc)/100*(r[r.length-1].value-r[r.length-2].value)):r[l-1].value+(r.length-1)*((t-r[l-1].perc)/100*(r[l].value-r[l-1].value))}}o=parseFloat(o.toFixed(this.precision)),this.$emit("input",o),this.$nextTick((function(){n.displayTooltip(),n.$refs.tooltip&&n.$refs.tooltip.updatePopper()})),this.dragging||this.value===this.oldValue||(this.oldValue=this.value)}}}},r=e(21),component=Object(r.a)(o,(function(){var t=this,n=t._self._c;return n("div",{ref:"button",staticClass:"el-slider__button-wrapper",class:{hover:t.hovering,dragging:t.dragging},style:t.wrapperStyle,attrs:{tabindex:"0"},on:{mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave,mousedown:t.onButtonDown,touchstart:t.onButtonDown,focus:t.handleMouseEnter,blur:t.handleMouseLeave,keydown:[function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"left",37,n.key,["Left","ArrowLeft"])||"button"in n&&0!==n.button?null:t.onLeftKeyDown.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"right",39,n.key,["Right","ArrowRight"])||"button"in n&&2!==n.button?null:t.onRightKeyDown.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"down",40,n.key,["Down","ArrowDown"])?null:(n.preventDefault(),t.onLeftKeyDown.apply(null,arguments))},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"up",38,n.key,["Up","ArrowUp"])?null:(n.preventDefault(),t.onRightKeyDown.apply(null,arguments))}]}},[n("el-tooltip",{ref:"tooltip",attrs:{placement:"top","popper-class":t.tooltipClass,disabled:!t.showTooltip}},[n("span",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(t.formatValue))]),t._v(" "),n("div",{staticClass:"el-slider__button",class:{hover:t.hovering,dragging:t.dragging}})])],1)}),[],!1,null,null,null);n.default=component.exports}}]);
- //# sourceMappingURL=9e71bd9.js.map
|