diff --git a/README.md b/README.md index 483fe27..10515ae 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ The following props can be passed to the component: | padding | Pads the right of each star so distance between stars can be altered | 0 | | fixed-points | Specify a fixed number of digits after the decimal point. | null | | rtl | Pass true to display star rating using rtl (right-to-left) | false | +| round-start-rating | Pass false if you don't want the start rating value to round to the closest increment. The user will still only be able to select based on the given increment. | true | **Important:** Vue requires you to pass numbers and boolean values using `v-bind`, any props that require a number or bool should use `v-bind:` or the colon (`:`) shorthand. diff --git a/dist/star-rating.min.js b/dist/star-rating.min.js index d6713c2..52d0b70 100644 --- a/dist/star-rating.min.js +++ b/dist/star-rating.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("VueStarRating",[],e):"object"==typeof exports?exports.VueStarRating=e():t.VueStarRating=e()}(this,function(){return 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={};return 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=2)}([function(t,e){t.exports=function(t,e,n,r,i){var o,a=t=t||{},s=typeof t.default;"object"!==s&&"function"!==s||(o=t,a=t.default);var u="function"==typeof a?a.options:a;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns),r&&(u._scopeId=r);var d;if(i?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=d):n&&(d=n),d){var l=u.functional,c=l?u.render:u.beforeCreate;l?u.render=function(t,e){return d.call(e),c(t,e)}:u.beforeCreate=c?[].concat(c,d):[d]}return{esModule:o,exports:a,options:u}}},function(t,e,n){function r(t){n(10)}var i=n(0)(n(3),n(9),r,"data-v-34cbeed1",null);t.exports=i.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={components:{star:i.default},model:{prop:"rating",event:"rating-selected"},props:{increment:{type:Number,default:1},rating:{type:Number,default:0},activeColor:{type:String,default:"#ffd055"},inactiveColor:{type:String,default:"#d8d8d8"},maxRating:{type:Number,default:5},starSize:{type:Number,default:50},showRating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},textClass:{type:String,default:""},inline:{type:Boolean,default:!1},borderColor:{type:String,default:"#999"},borderWidth:{type:Number,default:0},padding:{type:Number,default:0},rtl:{type:Boolean,default:!1},fixedPoints:{type:Number,default:null}},created:function(){this.step=100*this.increment,this.currentRating=this.rating,this.selectedRating=this.rating,this.createStars()},methods:{setRating:function(t,e){if(!this.readOnly){var n=this.rtl?(100-t.position)/100:t.position/100;this.currentRating=(t.id+n-1).toFixed(2),this.currentRating=this.currentRating>this.maxRating?this.maxRating:this.currentRating,this.createStars(),e?(this.selectedRating=this.currentRating,this.$emit("rating-selected",this.selectedRating)):this.$emit("current-rating",this.currentRating)}},resetRating:function(){this.readOnly||(this.currentRating=this.selectedRating,this.createStars())},createStars:function(){this.round();for(var t=0;t1?100:100*(this.currentRating-t)),this.$set(this.fillLevel,t,Math.round(e))}},round:function(){var t=1/this.increment;this.currentRating=Math.min(this.maxRating,Math.ceil(this.currentRating*t)/t)}},computed:{formattedRating:function(){return null===this.fixedPoints?this.currentRating:this.currentRating.toFixed(this.fixedPoints)}},watch:{rating:function(t){this.currentRating=t,this.selectedRating=t,this.createStars()}},data:function(){return{step:0,fillLevel:[],currentRating:0,selectedRating:0}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{fill:{type:Number,default:0},size:{type:Number,default:50},starId:{type:Number,required:!0},activeColor:{type:String,required:!0},inactiveColor:{type:String,required:!0},borderColor:{type:String,default:"#000"},borderWidth:{type:Number,default:0},padding:{type:Number,default:0},rtl:{type:Boolean,default:!1}},created:function(){this.calculatePoints,this.grad=Math.random().toString(36).substring(7)},computed:{calculatePoints:function(){var t=this;this.starPoints=this.starPoints.map(function(e){return t.size/43*e+1.5*t.borderWidth})},starPointsToString:function(){return this.starPoints.join(",")},getGradId:function(){return"url(#"+this.grad+")"},getSize:function(){return parseInt(this.size)+parseInt(3*this.borderWidth)+this.padding},getFill:function(){return this.rtl?100-this.fill+"%":this.fill+"%"}},methods:{mouseMoving:function(t){this.$emit("star-mouse-move",{event:t,position:this.getPosition(t),id:this.starId})},getPosition:function(t){var e=.92*this.size,n=Math.round(100/e*t.offsetX);return Math.min(n,100)},selected:function(t){this.$emit("star-selected",{id:this.starId,position:this.getPosition(t)})}},data:function(){return{starPoints:[19.8,2.2,6.6,43.56,39.6,17.16,0,17.16,33,43.56],grad:""}}}},function(t,e,n){e=t.exports=n(6)(void 0),e.push([t.i,".star[data-v-34cbeed1]{display:inline-block}.pointer[data-v-34cbeed1]{cursor:pointer}.star-rating[data-v-34cbeed1]{display:flex;align-items:center}.inline[data-v-34cbeed1]{display:inline-flex}.rating-text[data-v-34cbeed1]{margin-top:7px;margin-left:7px}.star-rating-rtl[data-v-34cbeed1]{direction:rtl}.star-rating-rtl .rating-text[data-v-34cbeed1]{margin-right:10px;direction:rtl}",""])},function(t,e){function n(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;ithis.maxRating?this.maxRating:this.currentRating,this.createStars(),e?(this.selectedRating=this.currentRating,this.$emit("rating-selected",this.selectedRating),this.ratingSelected=!0):this.$emit("current-rating",this.currentRating)}},resetRating:function(){this.readOnly||(this.currentRating=this.selectedRating,this.createStars(this.shouldRound))},createStars:function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.round();for(var t=0;t1?100:100*(this.currentRating-t)),this.$set(this.fillLevel,t,Math.round(e))}},round:function(){var t=1/this.increment;this.currentRating=Math.min(this.maxRating,Math.ceil(this.currentRating*t)/t)}},computed:{formattedRating:function(){return null===this.fixedPoints?this.currentRating:this.currentRating.toFixed(this.fixedPoints)},shouldRound:function(){return this.ratingSelected||this.roundStartRating}},watch:{rating:function(t){this.currentRating=t,this.selectedRating=t,this.createStars()}},data:function(){return{step:0,fillLevel:[],currentRating:0,selectedRating:0,ratingSelected:!1}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{fill:{type:Number,default:0},size:{type:Number,default:50},starId:{type:Number,required:!0},activeColor:{type:String,required:!0},inactiveColor:{type:String,required:!0},borderColor:{type:String,default:"#000"},borderWidth:{type:Number,default:0},padding:{type:Number,default:0},rtl:{type:Boolean,default:!1}},created:function(){this.calculatePoints,this.grad=Math.random().toString(36).substring(7)},computed:{calculatePoints:function(){var t=this;this.starPoints=this.starPoints.map(function(e){return t.size/43*e+1.5*t.borderWidth})},starPointsToString:function(){return this.starPoints.join(",")},getGradId:function(){return"url(#"+this.grad+")"},getSize:function(){return parseInt(this.size)+parseInt(3*this.borderWidth)+this.padding},getFill:function(){return this.rtl?100-this.fill+"%":this.fill+"%"}},methods:{mouseMoving:function(t){this.$emit("star-mouse-move",{event:t,position:this.getPosition(t),id:this.starId})},getPosition:function(t){var e=.92*this.size,r=this.rtl?Math.min(t.offsetX,45):Math.max(t.offsetX,1),n=Math.round(100/e*r);return Math.min(n,100)},selected:function(t){this.$emit("star-selected",{id:this.starId,position:this.getPosition(t)})}},data:function(){return{starPoints:[19.8,2.2,6.6,43.56,39.6,17.16,0,17.16,33,43.56],grad:""}}}},function(t,e,r){e=t.exports=r(6)(void 0),e.push([t.i,".vue-star-rating-star[data-v-34cbeed1]{display:inline-block}.vue-star-rating-pointer[data-v-34cbeed1]{cursor:pointer}.vue-star-rating[data-v-34cbeed1]{display:flex;align-items:center}.vue-star-rating-inline[data-v-34cbeed1]{display:inline-flex}.vue-star-rating-rating-text[data-v-34cbeed1]{margin-top:7px;margin-left:7px}.vue-star-rating-rtl[data-v-34cbeed1]{direction:rtl}.vue-star-rating-rtl .vue-star-rating-rating-text[data-v-34cbeed1]{margin-right:10px;direction:rtl}",""])},function(t,e){function r(t,e){var r=t[1]||"",i=t[3];if(!i)return r;if(e&&"function"==typeof btoa){var a=n(i);return[r].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([a]).join("\n")}return[r].join("\n")}function n(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=r(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;ir.parts.length&&(n.parts.length=r.parts.length)}else{for(var o=[],i=0;i this.maxRating ? this.maxRating : this.currentRating;\n this.createStars();\n if (persist) {\n this.selectedRating = this.currentRating;\n this.$emit('rating-selected', this.selectedRating);\n } else {\n this.$emit('current-rating', this.currentRating);\n }\n }\n },\n resetRating: function resetRating() {\n if (!this.readOnly) {\n this.currentRating = this.selectedRating;\n this.createStars();\n }\n },\n createStars: function createStars() {\n this.round();\n for (var i = 0; i < this.maxRating; i++) {\n var level = 0;\n if (i < this.currentRating) {\n level = this.currentRating - i > 1 ? 100 : (this.currentRating - i) * 100;\n }\n this.$set(this.fillLevel, i, Math.round(level));\n }\n },\n round: function round() {\n var inv = 1.0 / this.increment;\n this.currentRating = Math.min(this.maxRating, Math.ceil(this.currentRating * inv) / inv);\n }\n },\n computed: {\n formattedRating: function formattedRating() {\n return this.fixedPoints === null ? this.currentRating : this.currentRating.toFixed(this.fixedPoints);\n }\n },\n watch: {\n rating: function rating(val) {\n this.currentRating = val;\n this.selectedRating = val;\n this.createStars();\n }\n },\n data: function data() {\n return {\n step: 0,\n fillLevel: [],\n currentRating: 0,\n selectedRating: 0\n };\n }\n}; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nexports.default = {\n props: {\n fill: {\n type: Number,\n default: 0\n },\n size: {\n type: Number,\n default: 50\n },\n starId: {\n type: Number,\n required: true\n },\n activeColor: {\n type: String,\n required: true\n },\n inactiveColor: {\n type: String,\n required: true\n },\n borderColor: {\n type: String,\n default: '#000'\n },\n borderWidth: {\n type: Number,\n default: 0\n },\n padding: {\n type: Number,\n default: 0\n },\n rtl: {\n type: Boolean,\n default: false\n }\n },\n created: function created() {\n this.calculatePoints;\n this.grad = Math.random().toString(36).substring(7);\n },\n\n computed: {\n calculatePoints: function calculatePoints() {\n var _this = this;\n\n this.starPoints = this.starPoints.map(function (point) {\n return _this.size / 43 * point + _this.borderWidth * 1.5;\n });\n },\n starPointsToString: function starPointsToString() {\n return this.starPoints.join(',');\n },\n getGradId: function getGradId() {\n return 'url(#' + this.grad + ')';\n },\n getSize: function getSize() {\n return parseInt(this.size) + parseInt(this.borderWidth * 3) + this.padding;\n },\n getFill: function getFill() {\n return this.rtl ? 100 - this.fill + '%' : this.fill + '%';\n }\n },\n methods: {\n mouseMoving: function mouseMoving($event) {\n this.$emit('star-mouse-move', {\n event: $event,\n position: this.getPosition($event),\n id: this.starId\n });\n },\n getPosition: function getPosition($event) {\n // calculate position in percentage.\n var starWidth = 92 / 100 * this.size;\n var position = Math.round(100 / starWidth * $event.offsetX);\n return Math.min(position, 100);\n },\n selected: function selected($event) {\n this.$emit('star-selected', {\n id: this.starId,\n position: this.getPosition($event)\n });\n }\n },\n data: function data() {\n return {\n starPoints: [19.8, 2.2, 6.6, 43.56, 39.6, 17.16, 0, 17.16, 33, 43.56],\n grad: ''\n };\n }\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(6)(undefined);\n// imports\n\n\n// module\nexports.push([module.i, \".star[data-v-34cbeed1]{display:inline-block}.pointer[data-v-34cbeed1]{cursor:pointer}.star-rating[data-v-34cbeed1]{display:flex;align-items:center}.inline[data-v-34cbeed1]{display:inline-flex}.rating-text[data-v-34cbeed1]{margin-top:7px;margin-left:7px}.star-rating-rtl[data-v-34cbeed1]{direction:rtl}.star-rating-rtl .rating-text[data-v-34cbeed1]{margin-right:10px;direction:rtl}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Component = __webpack_require__(0)(\n /* script */\n __webpack_require__(4),\n /* template */\n __webpack_require__(8),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('svg', {\n staticStyle: {\n \"overflow\": \"visible\"\n },\n attrs: {\n \"height\": _vm.getSize,\n \"width\": _vm.getSize\n },\n on: {\n \"mousemove\": _vm.mouseMoving,\n \"click\": _vm.selected\n }\n }, [_c('linearGradient', {\n attrs: {\n \"id\": _vm.grad,\n \"x1\": \"0\",\n \"x2\": \"100%\",\n \"y1\": \"0\",\n \"y2\": \"0\"\n }\n }, [_c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.inactiveColor : _vm.activeColor\n }\n }), _vm._v(\" \"), _c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.activeColor : _vm.inactiveColor\n }\n })], 1), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId,\n \"stroke\": _vm.borderColor,\n \"stroke-width\": _vm.borderWidth\n }\n }), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId\n }\n })], 1)\n},staticRenderFns: []}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n class: ['star-rating', {\n 'star-rating-rtl': _vm.rtl\n }, {\n inline: _vm.inline\n }]\n }, [_c('div', {\n staticClass: \"star-rating\",\n on: {\n \"mouseleave\": _vm.resetRating\n }\n }, [_vm._l((_vm.maxRating), function(n) {\n return _c('span', {\n class: [{\n pointer: !_vm.readOnly\n }, 'star']\n }, [_c('star', {\n attrs: {\n \"fill\": _vm.fillLevel[n - 1],\n \"size\": _vm.starSize,\n \"star-id\": n,\n \"step\": _vm.step,\n \"active-color\": _vm.activeColor,\n \"inactive-color\": _vm.inactiveColor,\n \"border-color\": _vm.borderColor,\n \"border-width\": _vm.borderWidth,\n \"padding\": _vm.padding,\n \"rtl\": _vm.rtl\n },\n on: {\n \"star-selected\": function($event) {\n _vm.setRating($event, true)\n },\n \"star-mouse-move\": _vm.setRating\n }\n })], 1)\n }), _vm._v(\" \"), (_vm.showRating) ? _c('span', {\n class: ['rating-text', _vm.textClass]\n }, [_vm._v(\" \" + _vm._s(_vm.formattedRating))]) : _vm._e()], 2)])\n},staticRenderFns: []}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a \r\n\n\n\n// WEBPACK FOOTER //\n// star-rating.vue?a5ae70f6","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// star.vue?bd55aafc","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".star[data-v-34cbeed1]{display:inline-block}.pointer[data-v-34cbeed1]{cursor:pointer}.star-rating[data-v-34cbeed1]{display:flex;align-items:center}.inline[data-v-34cbeed1]{display:inline-flex}.rating-text[data-v-34cbeed1]{margin-top:7px;margin-left:7px}.star-rating-rtl[data-v-34cbeed1]{direction:rtl}.star-rating-rtl .rating-text[data-v-34cbeed1]{margin-right:10px;direction:rtl}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader?minimize!./~/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-34cbeed1\",\"scoped\":true,\"hasInlineConfig\":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/star-rating.vue\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","var Component = require(\"!../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./star.vue\"),\n /* template */\n require(\"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-21f5376e\\\"}!../node_modules/vue-loader/lib/selector?type=template&index=0!./star.vue\"),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/star.vue\n// module id = 7\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('svg', {\n staticStyle: {\n \"overflow\": \"visible\"\n },\n attrs: {\n \"height\": _vm.getSize,\n \"width\": _vm.getSize\n },\n on: {\n \"mousemove\": _vm.mouseMoving,\n \"click\": _vm.selected\n }\n }, [_c('linearGradient', {\n attrs: {\n \"id\": _vm.grad,\n \"x1\": \"0\",\n \"x2\": \"100%\",\n \"y1\": \"0\",\n \"y2\": \"0\"\n }\n }, [_c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.inactiveColor : _vm.activeColor\n }\n }), _vm._v(\" \"), _c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.activeColor : _vm.inactiveColor\n }\n })], 1), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId,\n \"stroke\": _vm.borderColor,\n \"stroke-width\": _vm.borderWidth\n }\n }), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId\n }\n })], 1)\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-21f5376e\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/star.vue\n// module id = 8\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n class: ['star-rating', {\n 'star-rating-rtl': _vm.rtl\n }, {\n inline: _vm.inline\n }]\n }, [_c('div', {\n staticClass: \"star-rating\",\n on: {\n \"mouseleave\": _vm.resetRating\n }\n }, [_vm._l((_vm.maxRating), function(n) {\n return _c('span', {\n class: [{\n pointer: !_vm.readOnly\n }, 'star']\n }, [_c('star', {\n attrs: {\n \"fill\": _vm.fillLevel[n - 1],\n \"size\": _vm.starSize,\n \"star-id\": n,\n \"step\": _vm.step,\n \"active-color\": _vm.activeColor,\n \"inactive-color\": _vm.inactiveColor,\n \"border-color\": _vm.borderColor,\n \"border-width\": _vm.borderWidth,\n \"padding\": _vm.padding,\n \"rtl\": _vm.rtl\n },\n on: {\n \"star-selected\": function($event) {\n _vm.setRating($event, true)\n },\n \"star-mouse-move\": _vm.setRating\n }\n })], 1)\n }), _vm._v(\" \"), (_vm.showRating) ? _c('span', {\n class: ['rating-text', _vm.textClass]\n }, [_vm._v(\" \" + _vm._s(_vm.formattedRating))]) : _vm._e()], 2)])\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-34cbeed1\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/star-rating.vue\n// module id = 9\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// star-rating.vue?85bd2db8","\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// star.vue?2c8a332d","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".vue-star-rating-star[data-v-34cbeed1]{display:inline-block}.vue-star-rating-pointer[data-v-34cbeed1]{cursor:pointer}.vue-star-rating[data-v-34cbeed1]{display:flex;align-items:center}.vue-star-rating-inline[data-v-34cbeed1]{display:inline-flex}.vue-star-rating-rating-text[data-v-34cbeed1]{margin-top:7px;margin-left:7px}.vue-star-rating-rtl[data-v-34cbeed1]{direction:rtl}.vue-star-rating-rtl .vue-star-rating-rating-text[data-v-34cbeed1]{margin-right:10px;direction:rtl}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader?minimize!./~/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-34cbeed1\",\"scoped\":true,\"hasInlineConfig\":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/star-rating.vue\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","var Component = require(\"!../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./star.vue\"),\n /* template */\n require(\"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-21f5376e\\\"}!../node_modules/vue-loader/lib/selector?type=template&index=0!./star.vue\"),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/star.vue\n// module id = 7\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('svg', {\n staticStyle: {\n \"overflow\": \"visible\"\n },\n attrs: {\n \"height\": _vm.getSize,\n \"width\": _vm.getSize\n },\n on: {\n \"mousemove\": _vm.mouseMoving,\n \"click\": _vm.selected\n }\n }, [_c('linearGradient', {\n attrs: {\n \"id\": _vm.grad,\n \"x1\": \"0\",\n \"x2\": \"100%\",\n \"y1\": \"0\",\n \"y2\": \"0\"\n }\n }, [_c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.inactiveColor : _vm.activeColor\n }\n }), _vm._v(\" \"), _c('stop', {\n attrs: {\n \"offset\": _vm.getFill,\n \"stop-color\": (_vm.rtl) ? _vm.activeColor : _vm.inactiveColor\n }\n })], 1), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId,\n \"stroke\": _vm.borderColor,\n \"stroke-width\": _vm.borderWidth\n }\n }), _vm._v(\" \"), _c('polygon', {\n attrs: {\n \"points\": _vm.starPointsToString,\n \"fill\": _vm.getGradId\n }\n })], 1)\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-21f5376e\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/star.vue\n// module id = 8\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n class: ['vue-star-rating', {\n 'vue-star-rating-rtl': _vm.rtl\n }, {\n 'vue-star-rating-inline': _vm.inline\n }]\n }, [_c('div', {\n staticClass: \"vue-star-rating\",\n on: {\n \"mouseleave\": _vm.resetRating\n }\n }, [_vm._l((_vm.maxRating), function(n) {\n return _c('span', {\n class: [{\n 'vue-star-rating-pointer': !_vm.readOnly\n }, 'vue-star-rating-star']\n }, [_c('star', {\n attrs: {\n \"fill\": _vm.fillLevel[n - 1],\n \"size\": _vm.starSize,\n \"star-id\": n,\n \"step\": _vm.step,\n \"active-color\": _vm.activeColor,\n \"inactive-color\": _vm.inactiveColor,\n \"border-color\": _vm.borderColor,\n \"border-width\": _vm.borderWidth,\n \"padding\": _vm.padding,\n \"rtl\": _vm.rtl\n },\n on: {\n \"star-selected\": function($event) {\n _vm.setRating($event, true)\n },\n \"star-mouse-move\": _vm.setRating\n }\n })], 1)\n }), _vm._v(\" \"), (_vm.showRating) ? _c('span', {\n class: ['vue-star-rating-rating-text', _vm.textClass]\n }, [_vm._v(\" \" + _vm._s(_vm.formattedRating))]) : _vm._e()], 2)])\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-34cbeed1\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/star-rating.vue\n// module id = 9\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a