UNPKG

vue-range-input

Version:
2 lines 14.4 kB
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=11)}([function(t,e,n){t.exports=!n(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(17);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(6),i=n(5);t.exports=function(t){return r(i(t))}},function(t,e,n){n(44);var r=n(42)(n(10),n(43),"data-v-13fde88e",null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={name:"vue-range-input",data:function(){return{styleOffset:24,upperStyle:{},lowerStyle:{},inputCount:1,slider:{lowerVal:0,upperVal:0,min:0,max:0}}},mounted:function(){},computed:{compUpperStyle:function(){return(0,i.default)(this.upperStyle,{"--round":this.roundColor})},compLowerStyle:function(){return(0,i.default)(this.lowerStyle,{"--round":this.roundColor})},lineStyleDual:function(){return{width:this.lineWidthOnlyUpper-this.lineLeftOffset+this.styleOffset+"px",left:this.styleOffset+this.lineLeftOffset-this.styleOffset/2+"px","background-color":this.color,"--color":this.dotColor,"--display":"block"}},lineStyleSolo:function(){return{width:this.lineWidthOnlyUpper+this.styleOffset/2+"px",left:"0","background-color":this.color,"--color":this.dotColor,"--display":"none"}},lineStyle:function(){return this.initialVal[1]?this.lineStyleDual:this.lineStyleSolo},lineLeftOffset:function(){return this.indexCalc(this.slider.lowerVal)},lineWidthOnlyUpper:function(){return this.indexCalc(this.slider.upperVal)}},methods:{indexCalc:function(t){return(this.width-this.styleOffset*this.inputCount)/(this.slider.max-this.slider.min)*(t-this.slider.min)},eventDataValues:function(){return this.initialVal[1]?[parseInt(this.slider.lowerVal),parseInt(this.slider.upperVal)]:parseInt(this.slider.upperVal)},upperSliderOnInput:function(){this.slider.upperVal<parseInt(this.slider.lowerVal)&&(this.slider.lowerVal=this.slider.upperVal),this.$emit("input",this.eventDataValues())},lowerSliderOnInput:function(){this.slider.lowerVal>this.slider.upperVal&&(this.slider.upperVal=parseInt(this.slider.lowerVal)),this.$emit("input",this.eventDataValues())}},created:function(){this.slider.min=this.min,this.slider.max=this.max,this.slider.lowerVal=this.initialVal[0],this.inputCount=this.initialVal.length,this.initialVal[1]?(this.slider.upperVal=this.initialVal[1],this.upperStyle={left:this.styleOffset+"px",width:this.width-this.styleOffset+"px"},this.lowerStyle={left:"0",width:this.width-this.styleOffset+"px"}):(this.slider.upperVal=this.initialVal[0],this.upperStyle={left:"0",width:this.width+"px"})},props:{min:Number,max:Number,initialVal:Array,width:Number,bgColor:String,color:String,dotColor:String,roundColor:String}}},function(t,e,n){"use strict";var r=n(9);t.exports=r},function(t,e,n){t.exports={default:n(13),__esModule:!0}},function(t,e,n){n(39),t.exports=n(4).Object.assign},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(3);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(8),i=n(35),o=n(34);t.exports=function(t){return function(e,n,a){var u,s=r(e),l=i(s.length),p=o(a,l);if(t&&n!=n){for(;l>p;)if((u=s[p++])!=u)return!0}else for(;l>p;p++)if((t||p in s)&&s[p]===n)return t||p||0;return!t&&-1}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(14);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(3),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(2),i=n(4),o=n(18),a=n(23),u=function(t,e,n){var s,l,p,f=t&u.F,c=t&u.G,d=t&u.S,h=t&u.P,v=t&u.B,y=t&u.W,m=c?i:i[e]||(i[e]={}),g=m.prototype,x=c?r:d?r[e]:(r[e]||{}).prototype;c&&(n=e);for(s in n)(l=!f&&x&&void 0!==x[s])&&s in m||(p=l?x[s]:n[s],m[s]=c&&"function"!=typeof x[s]?n[s]:v&&l?o(p,r):y&&x[s]==p?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(p):h&&"function"==typeof p?o(Function.call,p):p,h&&((m.virtual||(m.virtual={}))[s]=p,t&u.R&&g&&!g[s]&&a(g,s,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(26),i=n(31);t.exports=n(0)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(0)&&!n(1)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(29),i=n(27),o=n(30),a=n(36),u=n(6),s=Object.assign;t.exports=!s||n(1)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=s({},t)[n]||Object.keys(s({},e)).join("")!=r})?function(t,e){for(var n=a(t),s=arguments.length,l=1,p=i.f,f=o.f;s>l;)for(var c,d=u(arguments[l++]),h=p?r(d).concat(p(d)):r(d),v=h.length,y=0;v>y;)f.call(d,c=h[y++])&&(n[c]=d[c]);return n}:s},function(t,e,n){var r=n(15),i=n(24),o=n(37),a=Object.defineProperty;e.f=n(0)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(22),i=n(8),o=n(16)(!1),a=n(32)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),s=0,l=[];for(n in u)n!=a&&r(u,n)&&l.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~o(l,n)||l.push(n));return l}},function(t,e,n){var r=n(28),i=n(20);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(33)("keys"),i=n(38);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(2),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(7),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(7),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(5);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(3);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(21);r(r.S+r.F,"Object",{assign:n(25)})},function(t,e,n){e=t.exports=n(41)(),e.push([t.i,'.vue-range-input[data-v-13fde88e]{overflow:hidden;position:relative;height:24px;border-radius:24px}.vue-range-input__line[data-v-13fde88e]{top:0;left:0;height:24px;position:absolute}.vue-range-input__line[data-v-13fde88e]:after,.vue-range-input__line[data-v-13fde88e]:before{content:" ";position:absolute;height:12px;width:12px;border-radius:12px;top:6px;background-color:var(--color)}.vue-range-input__line[data-v-13fde88e]:after{right:-6px}.vue-range-input__line[data-v-13fde88e]:before{display:var(--display);left:-6px}input[type=range][data-v-13fde88e]{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden;height:24px;margin:0;padding:0;border:0;border-radius:1px;outline:none;pointer-events:none;position:absolute;top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:none}input[type=range][data-v-13fde88e]:active,input[type=range][data-v-13fde88e]:focus{outline:none}input[type=range][data-v-13fde88e]::-webkit-slider-thumb{height:24px;width:24px;border-radius:24px;background-color:transparent;position:relative;cursor:pointer;-webkit-appearance:none;appearance:none;pointer-events:all;border:6px solid var(--round)}',""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e){t.exports=function(t,e,n,r){var i,o=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,o=t.default);var u="function"==typeof o?o.options:o;if(e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns),n&&(u._scopeId=n),r){var s=Object.create(u.computed||null);Object.keys(r).forEach(function(t){var e=r[t];s[t]=function(){return e}}),u.computed=s}return{esModule:i,exports:o,options:u}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-range-input",style:{width:this.width+"px","background-color":this.bgColor}},[n("div",{staticClass:"vue-range-input__line",style:t.lineStyle}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.slider.upperVal,expression:"slider.upperVal"}],staticClass:"vue-range-input__upper",style:t.compUpperStyle,attrs:{type:"range",min:t.slider.min,max:t.slider.max},domProps:{value:t.slider.upperVal},on:{input:t.upperSliderOnInput,__r:function(e){t.$set(t.slider,"upperVal",e.target.value)}}}),t._v(" "),t.initialVal[1]?n("input",{directives:[{name:"model",rawName:"v-model",value:t.slider.lowerVal,expression:"slider.lowerVal"}],staticClass:"vue-range-input__lower",style:t.compLowerStyle,attrs:{type:"range",min:t.slider.min,max:t.slider.max},domProps:{value:t.slider.lowerVal},on:{input:t.lowerSliderOnInput,__r:function(e){t.$set(t.slider,"lowerVal",e.target.value)}}}):t._e()])},staticRenderFns:[]}},function(t,e,n){var r=n(40);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(45)("d864a714",r,!0)},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=p[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));p[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",f.appendChild(t),t}function o(t){var e,n,r=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(y){var o=d++;r=c||(c=i()),e=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),e=u.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function a(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=m(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function u(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var s="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!s)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var l=n(46),p={},f=s&&(document.head||document.getElementsByTagName("head")[0]),c=null,d=0,h=!1,v=function(){},y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n){h=n;var i=l(t,e);return r(i),function(e){for(var n=[],o=0;o<i.length;o++){var a=i[o],u=p[a.id];u.refs--,n.push(u)}e?(i=l(t,e),r(i)):i=[];for(var o=0;o<n.length;o++){var u=n[o];if(0===u.refs){for(var s=0;s<u.parts.length;s++)u.parts[s]();delete p[u.id]}}}};var m=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=o[0],u=o[1],s=o[2],l=o[3],p={id:t+":"+i,css:u,media:s,sourceMap:l};r[a]?r[a].parts.push(p):n.push(r[a]={id:a,parts:[p]})}return n}}]); //# sourceMappingURL=index.js.map